Merge pull request #9 from Enderlein/master

Only update anime if it's status is "airing", Show number of retry attempts
master
Vishnunarayan K I 2018-06-18 08:38:09 +05:30 committed by GitHub
commit f7d71ee5dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View File

@ -280,7 +280,7 @@ def watch_anime(watcher, anime):
if returncode == mpv.STOP:
sys.exit(0)
elif returncode == mpv.CONNECT_ERR:
logging.warning("Couldn't connect. Retrying.")
logging.warning("Couldn't connect. Retrying. Attempt #{}".format(tries+1))
continue
anime.episodes_done += 1
watcher.update(anime)

View File

@ -155,7 +155,7 @@ def a(t, e):
def generate_(data):
DD = "iQDWcsGqN"
DD = "bVZX0bdD"
param_ = s(DD)
for key, value in data.items():

View File

@ -44,7 +44,6 @@ class Watcher:
meta=meta.get('Type', '')))
def anime_list(self):
# Stores list of anime names in watcher's list
return self._read_from_watch_file()
def get(self, anime_name):
@ -63,13 +62,14 @@ class Watcher:
return anime
def update_anime(self, anime):
logging.info('Updating anime {}'.format(anime.title))
newanime = AnimeInfo(anime.url, episodes_done=anime.episodes_done,
timestamp=time())
newanime.title = anime.title
if anime.meta['Status'].lower() == 'airing':
logging.info('Updating anime {}'.format(anime.title))
newanime = AnimeInfo(anime.url, episodes_done=anime.episodes_done,
timestamp=time())
newanime.title = anime.title
self.update(newanime)
return newanime
self.update(newanime)
return newanime
def add(self, anime):
self._append_to_watch_file(anime)