Skip to content
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

Merged
merged 14 commits into from
Jul 14, 2023

Conversation

arsaboo
Copy link
Contributor

@arsaboo arsaboo commented Jul 9, 2023

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

  • Documentation. (If you've add a new command-line flag, for example, find the appropriate page under docs/ to describe it.)
  • Changelog. (Add an entry to docs/changelog.rst near the top of the document.)
  • Tests. (Encouraged but not strictly required.)

@arsaboo arsaboo changed the title Added additional fields to be imported from Deezer Import additional fields from Deezer and add function to update rank Jul 9, 2023
Copy link
Member

@sampsyo sampsyo left a 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.

Comment on lines +79 to +82
if 'error' in album_data:
self._log.debug(f"Error fetching album {album_id}: "
f"{album_data['error']['message']}")
return None
Copy link
Member

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?

Copy link
Contributor Author

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(),
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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!

docs/changelog.rst Outdated Show resolved Hide resolved
Copy link
Member

@sampsyo sampsyo left a 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!!

@sampsyo sampsyo merged commit b19b961 into beetbox:master Jul 14, 2023
14 checks passed
@arsaboo arsaboo deleted the deezer branch July 15, 2023 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import rank from Deezer
2 participants