Import additional fields from Deezer and add function to update rank - #4842
Conversation
sampsyo
left a comment
There was a problem hiding this comment.
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.
Cool; this seems like an important addition! Maybe it deserves its own changelog bullet point?
There was a problem hiding this comment.
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.
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.
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.
Co-authored-by: Adrian Sampson <adrian@radbox.org>
Description
Fixes #4841
Imports few other fields provided by Deezer.
In addition, I added a function
deezerupdatethat 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.rstnear the top of the document.)