From a99f794174027c4c9374d72e20a242ef2b00c697 Mon Sep 17 00:00:00 2001 From: Lars Noack Date: Fri, 25 Nov 2022 08:29:18 +0100 Subject: [PATCH] lyrics obj --- src/music_kraken/database/database.py | 5 +++++ src/music_kraken/database/lyrics.py | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 src/music_kraken/database/lyrics.py diff --git a/src/music_kraken/database/database.py b/src/music_kraken/database/database.py index bcfd770..f2ba22c 100644 --- a/src/music_kraken/database/database.py +++ b/src/music_kraken/database/database.py @@ -235,6 +235,11 @@ WHERE '{track_id}' == id; self.cursor.execute(query) self.connection.commit() + def set_field_of_song(self, track_id: str, key: str, value: str): + query = f"UPDATE track SET {key} = ? WHERE '{track_id}' == id;" + self.cursor.execute(query, (value, )) + self.connection.commit() + def set_download_data(self, track_id: str, url: str, src: str): query = f""" UPDATE track diff --git a/src/music_kraken/database/lyrics.py b/src/music_kraken/database/lyrics.py new file mode 100644 index 0000000..4a9ab0b --- /dev/null +++ b/src/music_kraken/database/lyrics.py @@ -0,0 +1,7 @@ +class Lyrics: + def __init__(self, text: str = None, language: str = None) -> None: + self.text = text + self.language = language + + def set_lyrics(self, text: str, language: str): + pass