Skip to content

Commit

Permalink
Merge pull request #17 from panizza/master
Browse files Browse the repository at this point in the history
Refactoring + Autofollow
the-lazy-fox authored Apr 12, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 2fa5df9 + 49eaaea commit 58bc4a8
Showing 6 changed files with 275 additions and 187 deletions.
436 changes: 252 additions & 184 deletions default.py

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions resources/language/English/strings.po
Original file line number Diff line number Diff line change
@@ -41,6 +41,10 @@ msgctxt "#32303"
msgid "Mark the http streams"
msgstr ""

msgctxt "#32304"
msgid "Auto-follow the show if not already followed"
msgstr ""

msgctxt "#33001"
msgid "Notifications"
msgstr ""
4 changes: 4 additions & 0 deletions resources/language/French/strings.po
Original file line number Diff line number Diff line change
@@ -41,6 +41,10 @@ msgctxt "#32303"
msgid "Mark the http streams"
msgstr "Marquer les flux http"

msgctxt "#32304"
msgid "Auto-follow the show if not already followed"
msgstr "Suivre automatiquement le spectacle s'il n'est pas déjà suivi"

msgctxt "#33001"
msgid "Notifications"
msgstr "Notifications"
4 changes: 4 additions & 0 deletions resources/language/Italian/strings.po
Original file line number Diff line number Diff line change
@@ -41,6 +41,10 @@ msgctxt "#32303"
msgid "Mark the http streams"
msgstr "Segna i flussi http"

msgctxt "#32304"
msgid "Auto-follow the show if not already followed"
msgstr "Segui automaticamente lo show se non è già seguito"

msgctxt "#33001"
msgid "Notifications"
msgstr "Notifiche"
13 changes: 10 additions & 3 deletions resources/lib/tvtime.py
Original file line number Diff line number Diff line change
@@ -45,6 +45,7 @@ def __init__(self, token, episode_id, filename=''):
else:
self.is_found = True
self.resultdata = data['result']
self.showid = data['episode']['show']['id']
self.showname = data['episode']['show']['name']
self.episodename = data['episode']['name']
self.season_number = data['episode']['season_number']
@@ -157,21 +158,27 @@ def __init__(self, token, episode_id):
self.is_watched = data['code']

class MarkAsWatched(object):
def __init__(self, token, episode_id, facebook=0, twitter=0):
def __init__(self, token, episode_id, facebook=0, twitter=0, autofollow=1):
self.token = token
self.episode_id = episode_id

self.facebook = facebook
if self.facebook == True: self.facebook = 1
else: self.facebook = 0

self.twitter = twitter
if self.twitter == True: self.twitter = 1
else: self.twitter = 0

self.autofollow = autofollow
self.action = 'checkin'

request_data = urllib.parse.urlencode({
'access_token' : self.token,
'episode_id' : self.episode_id,
'publish_on_ticker' : self.facebook,
'publish_on_twitter' : self.twitter
'publish_on_twitter' : self.twitter,
'auto_follow': self.autofollow
}).encode("utf-8")

self.cj = http.cookiejar.CookieJar()
@@ -198,7 +205,7 @@ def __init__(self, token, episode_id, facebook=0, twitter=0):
self.is_marked = False
else:
self.is_marked = True

class MarkAsUnWatched(object):
def __init__(self, token, episode_id):
self.token = token
1 change: 1 addition & 0 deletions resources/settings.xml
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
<setting id="user" type="text" label="32301" enable="false" />
<setting id="progress" type="bool" label="32302" default="true" />
<setting id="http" type="bool" label="32303" default="false" />
<setting id="autofollow" type="bool" label="32304" default="true" />
</category>
<category label="33001">
<setting id="notifications" type="bool" label="33301" default="true" />

0 comments on commit 58bc4a8

Please sign in to comment.