diff --git a/src/metadata/database.py b/src/metadata/database.py index da78c7a..fad96b2 100644 --- a/src/metadata/database.py +++ b/src/metadata/database.py @@ -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)