added lyrics to the db

This commit is contained in:
Lars Noack 2022-11-14 14:57:44 +01:00
parent 334446799b
commit 06ae9750ce

View File

@ -171,7 +171,8 @@ SELECT DISTINCT
'file', track.file,
'genre', track.genre,
'url', track.url,
'src', track.src
'src', track.src,
'lyrics', track.lyrics
)
FROM track, release_, release_group,artist, artist_track
WHERE
@ -204,6 +205,15 @@ GROUP BY track.id;
def get_tracks_without_filepath(self):
return self.get_custom_track(["(track.file IS NULL OR track.path IS NULL OR track.genre IS NULL)"])
def add_lyrics(self, track_id: str, lyrics: str):
query = f"""
UPDATE track
SET lyrics = ?
WHERE '{track_id}' == id;
"""
self.cursor.execute(query, (lyrics, ))
self.connection.commit()
def update_download_status(self, track_id: str):
query = f"UPDATE track SET downloaded = 1, WHERE '{track_id}' == id;"
self.cursor.execute(query)