diff --git a/deemon/__init__.py b/deemon/__init__.py index 2225a68..a47116f 100644 --- a/deemon/__init__.py +++ b/deemon/__init__.py @@ -1,3 +1,3 @@ #!/usr/bin/env python3 -__version__ = '1.0.5' +__version__ = '1.0.6' diff --git a/deemon/app/refresh.py b/deemon/app/refresh.py index 6f4d149..f101210 100644 --- a/deemon/app/refresh.py +++ b/deemon/app/refresh.py @@ -20,11 +20,10 @@ def __init__(self, artist_id: list = None, skip_download: bool = False): self.monitored_artists = [] self.queue_list = [] self.new_releases = [] - self.release_date = "" - def is_future_release(self): + def is_future_release(self, album_release): today = utils.get_todays_date() - if self.release_date > today: + if album_release > today: return 1 else: return 0 @@ -96,13 +95,17 @@ def refresh(self): else: continue else: + release_in_future = self.is_future_release(album["release_date"]) + if release_in_future: + logger.debug(f"[PRE-RELEASE DETECTED] {artist['name']} - {album['title']} detected as a pre-release; " + f"will be released on {album['release_date']}") self.db.add_new_release( artist["id"], artist["name"], album["id"], album["title"], album["release_date"], - future_release=self.is_future_release() + future_release=release_in_future ) if self.skip_download or new_artist: