-
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
Add TIDAL autotagger plugin #5637
Open
jcjordyn130
wants to merge
24
commits into
beetbox:master
Choose a base branch
from
jcjordyn130:tidal_metadata
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+1,215
−3
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry. |
- Initial implementation of LRC writing support - Split imported file processing to its' own function
- Actually remove the session file instead of blanking it out
- Check for auto status before loading the TIDAL session
- Implement LFUCache on hot functions - Fix docstrings - Add backoff handler for debugging - Add fatal argument to _load_session to throw UserError - Reduce excessive calls for track metadata retrival - _search_track now returns tidalapi types and no longer grabs the full album metadata - Add user configurable result limits for both metadata and lyrics
- tidalapi was changed from a star import to a regular import - Logic error in _process_item was fixed, was used undefined track
- Fix duplicate track removal from _search_lyrics - Stop adding top_hit result twice in _search_album and _search_track
- Add output when the login was successful
It was never used and it can always be dumped with a regular `cat` command
- Break out _get_lyrics specific metadata searching algorithm into seperate function (_search_from_metadata) - Remove _search_album as it is now unused - Fix candidates function shadowing parameters - Candidate functions now use _search_from_metadata - Candidate functions now handle va_likely
The plugin has been operating on the original files this entire time. Changes: - Add a write event listener to write out sidecar files - Remove file management from the import stage, as this is already handled in Item.write()
This currently only works with synced lyrics and needs to be changed if TIDAL ever changes their lyrics format.
- Change _validate_lyrics to use tidalapi Track length instead of calculating length from lyrics - Change _search_from_metadata to search for alternative artists - Add config toggle for items with no duration to assume valid lyrics or not - Change _search_track so queries are stripped of special characters and medium details, as the TIDAL search engine is picky
Technically, Items can have an infinite number of max artists. Let's add a user-configurable cap to avoid excessive TIDAL API usage.
- Add another implementation of _serach_album - Remove unused variables from LRC timestamp calculation - Change candidates function to use _search_album instead of grabbing a new Album instance from _search_track - Change _search_from_metadata to search for albums as well - Fix logic errors and unused variables in _validate_lyrics
- Move the initial session load into __init__ as it is called before any of the plugin functions - Move query fixing into _tidal_search from the respective _search functions - Reworded UIError message in _load_session
- Ran `poe lint` and fixed all errors - Ran `poe format` - Reworded some docstrings to make them shorter - Split some strings between two lines to avoid going over line length limit
- Move _load_session from __init__ to an import_begin event handler
19781aa
to
c1b9f21
Compare
3b3e506
to
851b2b4
Compare
Turns out, _search_lyrics didn't use its own limit parameter and was directly using self.config.
851b2b4
to
68a1df7
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is a replacement of the last TIDAL PR I opened back in 2023 (#4641), as in, it is a proper autotagger implementation using the TIDAL API.
Candidate retrieval and support for direct TIDAL album and track URLs are supported.
It also fetches lyrics (both time-synced and not), and embeds it into both the file tags and a LRC file if configured.
Adding testing is a little complicated as testing lyrics support requires a paid account, however, basic metadata queries only require an account with or without an active subscription.
I have been using this plugin for about a week now with my library and it seems to be holding up, obtaining lyrics that are otherwise unavailable through the available lyrics backends.
Poetry files were changed to add optional dependencies for this plugin, which are tidalapi, cachetools (for LFU cache in hot functions), and backoff (to slow down queries when rate limited).
Also, please do let me know if you want me to squash my commits, as I know there are quite a few of them.
To Do
Changelog(Will add once change is approved)Tests