mirror of
https://github.com/beetbox/beets.git
synced 2025-12-31 21:12:43 +01:00
lyrics: Do not write item unless lyrics have changed
This commit is contained in:
parent
8bdc2c6cf0
commit
8a1ce27421
1 changed files with 7 additions and 9 deletions
|
|
@ -1077,15 +1077,13 @@ class LyricsPlugin(RequestHandler, plugins.BeetsPlugin):
|
|||
)
|
||||
else:
|
||||
self.info("🔴 Lyrics not found: {}", item)
|
||||
fallback = self.config["fallback"].get()
|
||||
if fallback:
|
||||
lyrics = fallback
|
||||
else:
|
||||
return
|
||||
item.lyrics = lyrics
|
||||
if write:
|
||||
item.try_write()
|
||||
item.store()
|
||||
lyrics = self.config["fallback"].get()
|
||||
|
||||
if lyrics not in {None, item.lyrics}:
|
||||
item.lyrics = lyrics
|
||||
if write:
|
||||
item.try_write()
|
||||
item.store()
|
||||
|
||||
def get_lyrics(self, artist: str, title: str, *args) -> str | None:
|
||||
"""Fetch lyrics, trying each source in turn. Return a string or
|
||||
|
|
|
|||
Loading…
Reference in a new issue