Repository navigation
Conversation
|
Just realized that the plugin has the problem that when a track's name is changed during tagging (and now also the artist, album, and track number), the synchronized lyrics are lost and only unsynchronized ones are written ://. I am not familiar enough with picard to know how to fix this, as this would require getting a key for a track that will stay the exact same after tagging. |
|
|
I did not know that the metadata object contains information about the file path. I have rewritten the logic to use the music file's original path as the key and it seems to work wonders. As per point 2, this is not needed as the music cache is used only to save the lyrics to a file after the user has chosen to save the file, and synchronized lyrics are always preferred over unsynchronized as per the label for the |
Great.
If you cache the sync lyrics first and unsynced lyrics second, then you won't be caching the synced lyrics. If synced lyrics are preferred, then you need to be certain that unsynced lyrics (if they exist) are cached first so that the cache is overwritten by the synced lyrics (or have logic to check and prevent the overwriting). |
|
P.S. Given that lyrics can be a 10s of KB, you might want to hook into the remove release functionality and purge the cache of all its entries. |
|
I do not see a real need for any of this tbh, as this plugin is a small script and the only place where the cache is written to already ensures that synchronized lyrics will be the ones written last, and also this whole caching logic was already present without the release functionality prior to my PR, but here you go, I implemented both of those things. |
|
If it were me I would cache the results of the web calls you make to get the lyrics, the purpose being to avoid making the same calls again if you reload or refresh the album because that is the expensive thing in elapsed time. That way if you have two versions of the same song, you would also reuse the cached data. |
|
I think that this is a big change that is out of scope for this PR and I would prefer to leave it as it is. |
|
This PR adds the caching functionality - so changing the caching approach is definitely in scope for this PR. However, my comment was only a suggestion - you are the author so the approach is your choice, and because this is a plugin and not core Picard, reviewers are likely to be more flexible about these things. |
|
This PR does not add the caching functionality; it has been there well before my PR and has only been a workaround for the plugin to be able to write synchronized lyrics to a file after fetching them before. The only thing I change is the cache key for which these lyrics are stored, while also adding some missing events in which the cache is released. |
This PR contains two functionalities regarding the
lrclib_lyricsplugin:.txtextension instead of.lrc. This follows a common convention, adopted for example by LRCGET, which is the program for downloading lyrics from lrclib listed on the lrclib website itself. Also, custom filename patterns for lyrics are now different for synced and unsynced files.