Skip to content

Commit

Permalink
fix regression when detecting pre-releases
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalec committed Jun 19, 2021
1 parent b8eee4b commit 53ee6c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion deemon/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env python3

__version__ = '1.0.5'
__version__ = '1.0.6'
11 changes: 7 additions & 4 deletions deemon/app/refresh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 53ee6c2

Please sign in to comment.