-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import additional fields from Deezer and add function to update rank #4842
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good overall! I just had a couple of minor questions based on a review.
if 'error' in album_data: | ||
self._log.debug(f"Error fetching album {album_id}: " | ||
f"{album_data['error']['message']}") | ||
return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool; this seems like an important addition! Maybe it deserves its own changelog bullet point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is required, but added it anyways :)
medium_index=track_data.get('track_position'), | ||
data_source=self.data_source, | ||
data_url=track_data['link'], | ||
deezer_updated=time.time(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't 100% see yet the need for this field… we only seem to be writing to it, never reading from it. Is it useful for some future functionality?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is useful to only update based on time elapsed. For example, update the tracks that have not been updated in the last 2 months. In the absence of this information, we will have to update all the tracks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it; that makes sense!
Co-authored-by: Adrian Sampson <adrian@radbox.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good; thanks!!
Description
Fixes #4841
Imports few other fields provided by Deezer.
In addition, I added a function
deezerupdate
that updates the rank information without going through the import process. The rank information is updated daily and users may want to refresh the rank information periodically.To Do
docs/
to describe it.)docs/changelog.rst
near the top of the document.)