Skip to content

Commit

Permalink
Added mal ID to watch.json
Browse files Browse the repository at this point in the history
  • Loading branch information
IguanasInPyjamas committed Oct 21, 2020
1 parent b2ce96d commit 7fe3207
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions anime_downloader/watch.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def _import_from_MAL(self, PATH):
mal_watch_status = str(list(values[mal_watch_status].keys())[0])
mal_title = type_tag.find('series_title').text
mal_episodes = type_tag.find('series_episodes').text
mal_ID = type_tag.find('series_animedb_id').text
#We have to initialise some values for when we add anime from MAL. Now, we do this instead of letting the user choose the provider
#On first run, this is so the user doesn't have to manually do hundreds of entries. The values initialise to one of the sites we already have
#But with a broken link, the provider needs to be set manually for a series by using the set command in the list.
Expand All @@ -157,6 +158,7 @@ def _import_from_MAL(self, PATH):
"score": int(mal_score),
"watch_status": mal_watch_status,
"colours": colour,
'mal_ID': int(mal_ID),
"url": ALL_ANIME_SITES[0][1],
"_fallback_qualities": ["720p", "480p", "360p"],
"quality": "720p",
Expand Down Expand Up @@ -210,9 +212,11 @@ class AnimeInfo(cls, sitename=cls.sitename):
def __init__(self, *args, **kwargs):
self.episodes_done = kwargs.pop('episodes_done', 0)
self._timestamp = kwargs.pop('timestamp', 0)
# Initial values needed for MAL which can't be got yet from just a simple addition to the watch list.
self.score = 0
self.watch_status = 'watching'
self.colours = 'blue'
self.mal_ID = 0
super(cls, self).__init__(*args, **kwargs)

def progress(self):
Expand Down

0 comments on commit 7fe3207

Please sign in to comment.