This commit is contained in:
Lars Noack
2022-12-06 17:55:07 +01:00
parent 37c8d894aa
commit cbb56499bf
5 changed files with 42 additions and 13 deletions

View File

@@ -10,4 +10,4 @@ Target = objects.Target
Metadata = objects.Metadata
Lyrics = objects.Lyrics
cache = temp_database.TempDatabase()
# cache = temp_database.TempDatabase()

View File

@@ -4,7 +4,7 @@ import logging
from typing import List
from pkg_resources import resource_string
from .song import (
from .objects import (
Song,
Lyrics,
Metadata,
@@ -74,7 +74,22 @@ class Database:
self.push_one(db_object)
def push_song(self, song: Song):
pass
# ADDING THE DATA FOR THE SONG OBJECT
"""
db_field - object attribute
-------------------------------
id - id
name - title
"""
table = "Song"
query = f"INSERT OR REPLACE INTO {table} (id, name) VALUES (?, ?);"
values = (
song.id,
song.title
)
self.cursor.execute(query, values)
self.connection.commit()
def push_lyrics(self, lyrics: Lyrics):
pass