lyricwiki - Please add support for local .lrc lyric files (patch included)
This was requested in forum topic "Support for LRC files for viewing in Audacious...", by Pascual Lucero a/b 6 mo.s ago with no response, so I decided to implement it, backport it to Audacious, and file it with a formal feature request. This patch allows user to both use and save lyrics from/to local (text) .lrc files, as well as a cpl. minor code cleanups. When a song plays (either local or stream/CD, etc., the patched lyricwiki plugin will first attempt to find a local lyric file with the same name (but .lrc) in the directory the song is in, then ~/.config/audacious[-#]/lyrics/ (local files only), then repeat the search for one matching the song's title (local files, streams, CDs, etc.), then, failing that, seek lyrics from lyricwiki (as now). An extra [Save Locally] button is also added allowing lyrics (if successfully fetched from lyricwiki) to be saved locally. If the song entry is a local file, a matching .lrc file will be saved in same directory as song file, otherwise, will be named after the title and saved in ~/.config/audacious[-#]/lyrics/ (/lyrics/) will be created if need be; and be loaded next time entry is played. The [Edit Lyrics...] button has been changed to [Edit Lyricwiki] to prevent confusion (as it does not edit local lyric files).
I also have a couple questions - looking at your Qt code: at line 263 there is still a reference to "lyrics.wikia.com" (which is not in the GTK side) - see "FIXME" comment in the QT patch. IDK is this is what could be causing issues (#888, #903)? I'm also not sure the reason for the extra code (Qt version, lines 298-302) that re-calls "step1".
#1 Updated by Ariadne Conill almost 2 years ago
Thanks for sending me these patches, I have found them quite useful for reference as I have been refactoring the LyricWiki plugin.
I have committed a significant refactoring of the plugin in the Qt version (I do not have GTK2 on my system and so I cannot test with GTK2, which is why I haven't ported my refactoring over to GTK2, besides we plan to drop the GTK2 stuff soonish), which cleanly separates concerns. There is now a `LyricWikiProvider` and a `FileProvider` abstraction, and saving lyrics for local files to local storage (as `filename.lrc` in the same way as cue files) is implemented there.
It would be useful to have these other features, but I think they need to be refactored for the new architecture of the plugin. If you're interested in helping with that, I would appreciate it -- I can walk you through any issues you might have and we can work together to build a high quality plugin!
#2 Updated by John Lindgren almost 2 years ago
I tried out the new local lyrics support in master this morning and it worked great. Very slick!
By the way, I plan on still keeping the GTK2 version in maintenance mode for a while yet, but I don't think it makes sense to be porting any new features to it at this point.
Is there anything left to be done under this issue, or can we close it now?
#3 Updated by Jim Turner almost 2 years ago
Ariadne: Wow - looks like you've done a bunch of work the last cpl. days on this! Sure, I'll be happy to help in any way I can. I'll grab your latest lyricwiki Qt vsn & try it out as soon as I get a chance (I've got some other stuff I need to get to this morning first though). My email is also under my name here on redmine if you need to reach me.
#4 Updated by Ariadne Conill almost 2 years ago
I think that what I have added is mostly functionally equivalent to what is in the diffs here. The only thing missing is guessing metadata from stream metadata, and I think that we should handle this in a more generic way -- I don't see it as in scope for the lyrics plugin.
Thanks to everyone for providing feedback :)