Skip to content

Add tags lyrics fetcher - #482

Closed
TilCreator wants to merge 1 commit into
ncmpcpp:masterfrom
TilCreator:add_tag_lyric_catcher
Closed

TilCreator wants to merge 1 commit into
ncmpcpp:masterfrom
TilCreator:add_tag_lyric_catcher

Conversation

@TilCreator

@TilCreator TilCreator commented May 5, 2021 •

Copy link
Copy Markdown
Contributor

This adds a new lyrics fetcher that reads the lyrics from the tags.
This implementation follows #440. It implements a new fetcher (like the genius one for example), but the lyrics are still written to a seperate txt file.
It would also be possible to implement this like suggested in #273, replacing the txt file with the lyrics tag. (with configuration parameters to preserve the old behavior)

Before continuing or implementing #273 I'm waiting for feedback.
I'm also not sure if I can find all lyrics tags, I currently only used bandcamp mastered music (flac, ogg, mp3) for testing.

@StillLynnTheCloset

Copy link
Copy Markdown

As I mentioned in #440 it would probably be best to let this be user configurable. Provide some reasonable default list of tags, but allow users to override it in their config. That way when someone comes along and asks why it isn't finding their lyrics, they can be pointed to the config option, rather than having to make a PR to update the hardcoded list.

@TilCreator

Copy link
Copy Markdown
Contributor Author

Good idea, I currently just use the default lyric tags of the tag lib, which should cover all, but you never know...
I will wait with the implementation until I know how I want to implement the lyrics fetcher, comments to that are very welcome.

@StillLynnTheCloset

Copy link
Copy Markdown

The spacing of the new song argument is off, but other than that, I can't help review this. I'm no good at C(++), and consequently I've never dug into this code.

@pbnoxious

Copy link
Copy Markdown

As the author of #273 this seems to be doing the first and most important part of what I originally suggested (reading lyrics from file tags), so I appreciate this PR.
I'm not much good at C++ either, so I'll refrain from commenting on the actual implementation

@TilCreator

Copy link
Copy Markdown
Contributor Author

My implementation question is more how should it behave, so you don't have to be a good c++ programmer to comment on that.
thx

@pbnoxious

Copy link
Copy Markdown

My idea was to have it similarly as you implemented it (if I understand the code correctly): offer it as an additional LyricsFetcher that users can choose from.

As you explicitely asked for comments, here are some quick thoughts:

I'm not sure if it makes sense to write the lyrics also to a txt file as for the other fetchers – they are already locally available and reading the tag is probably similarly fast as reading from the txt file.
I imagine that turning this off for just the TagsLyricsFetcher would require more fundamental changes to the whole lyrics fetching machinery. Because disk space is usually not an issue nowadays, this is a rather small issue and I'm happy with writing them, too. There also might be users that want to have the txt files, e.g. because they use the lyrics files also for other applications.

Another small thing that came to my mind: I think it would make sense to have this one first by default. It is likely the fastest of the fetchers and the chance of getting wrong lyrics is nearly zero. But also here: As long as this is a configurable option, it's not a bit thing for me and others might disagree.

As for the second part of my idea, being able to also write lyrics to the tag, this is more complex and there are multiple ways of doing it. Here are just some quick ideas,

  • Offer a new key binding in the lyrics editor that manually saves to the tag (probably the easiest option, but requires manual work when doing so)
  • Automatically save to the tag when it was empty before and lyrics were found (as configurable option)
  • Allow the user to manually "discard" the lyrics from the tag and fetch new ones from the other fetchers (not sure if this is a good idea)
    As this is only loosely combined to fetching the lyrics, that's something probably better left for a future PR.

Hope I could give you some input, thank you already for your work!

@arybczak arybczak left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, thanks.

Can you fix indentation of the MPD::Song parameter (have a look at Files changed tab to see) and add the tags fetcher to lyrics_fetchers in the doc/config and settings.cpp? As suggested, it can be put as the first position.

@bohanubis

Copy link
Copy Markdown

Yay this is gonna be fixed ❤️❤️

arybczak added a commit that referenced this pull request Sep 3, 2024
@arybczak

arybczak commented Sep 3, 2024

Copy link
Copy Markdown
Collaborator

Superseded by 9c27eec.

@arybczak arybczak closed this Sep 3, 2024
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.

5 participants