-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sourcery refactored master branch #8
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,16 +7,19 @@ def __init__(self): | |
self.clients = {} | ||
|
||
def add_client(self, ip, port, chanel_watch): | ||
self.clients[ip + ":" + port] = {"url": chanel_watch, "time_create": int(time.time())} | ||
self.clients[f"{ip}:{port}"] = { | ||
"url": chanel_watch, | ||
"time_create": int(time.time()), | ||
} | ||
Comment on lines
-10
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
||
def get_client(self, ip, port): | ||
# check if client is in the list | ||
print(self.clients) | ||
if ip + ":" + port not in self.clients: | ||
if f"{ip}:{port}" not in self.clients: | ||
return False | ||
# update time_create | ||
self.clients[ip + ":" + port]["time_create"] = int(time.time()) | ||
return self.clients[ip + ":" + port]["url"] | ||
self.clients[f"{ip}:{port}"]["time_create"] = int(time.time()) | ||
return self.clients[f"{ip}:{port}"]["url"] | ||
Comment on lines
-15
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
||
def remove_client(self): | ||
current_time = int(time.time()) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,10 +202,7 @@ def get_channel_url(self, stream_id): | |
channel = ( | ||
qb.select("iptv_channels").where([["stream_id", "=", stream_id]]).one() | ||
) | ||
if channel is None: | ||
return None | ||
|
||
return channel["direct_source"] | ||
return None if channel is None else channel["direct_source"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
||
|
||
class EPG_Parser: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function
live
refactored with the following changes:use-named-expression
)use-fstring-for-concatenation
)