added stuff

This commit is contained in:
Lars Noack 2023-01-30 15:57:01 +01:00
parent 39404dbbed
commit b46b9f5149
4 changed files with 9 additions and 6 deletions

View File

@ -30,10 +30,6 @@ cache = music_kraken.database.new_database.Database("test.db")
cache.reset()
def print_song(song_: Song):
print("tracksort", song_.tracksort, sep=": ")
# print("ID3", song_.metadata)
print(str(song_.metadata))
print("----src----")
print("song:")
@ -81,11 +77,12 @@ song = Song(
print_song(song)
exit()
song_ref = song.reference
cache.push([song])
exit()

View File

@ -16,7 +16,8 @@ from .objects import (
Album,
ID3Timestamp,
SourceTypes,
SourcePages
SourcePages,
SourceAttribute
)
logger = logging.getLogger("database")
@ -118,6 +119,10 @@ class Database:
if type(db_object) == Album:
return self.push_album(album=db_object)
if issubclass(type(db_object), SourceAttribute):
for source in db_object.source_list:
self.push_source(source=source)
logger.warning(f"type {type(db_object)} isn't yet supported by the db")
def push(self, db_object_list: List[Song | Lyrics | Target | Artist | Source | Album]):

View File

@ -12,6 +12,7 @@ ID3Timestamp = metadata.ID3Timestamp
SourceTypes = source.SourceTypes
SourcePages = source.SourcePages
SourceAttribute = source.SourceAttribute
Song = song.Song
Artist = song.Artist

BIN
test.db

Binary file not shown.