From df749118d7b24d4a64f46b59041a503166487ff8 Mon Sep 17 00:00:00 2001 From: Lars Noack Date: Fri, 13 Jan 2023 09:44:57 +0100 Subject: [PATCH] dfsa --- src/music_kraken/database/objects/metadata.py | 11 ++++++++++- src/music_kraken/database/objects/song.py | 9 ++++----- test.db | Bin 69632 -> 69632 bytes 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/music_kraken/database/objects/metadata.py b/src/music_kraken/database/objects/metadata.py index 5e45970..2e1f112 100644 --- a/src/music_kraken/database/objects/metadata.py +++ b/src/music_kraken/database/objects/metadata.py @@ -1,5 +1,5 @@ from enum import Enum -from typing import List +from typing import List, Dict, Tuple from mutagen import id3 from .parents import ( @@ -98,11 +98,20 @@ class Metadata: Shall only be read or edited via the Song object. call it like a dict to read/write values """ + class FrameValue: + def __init__(self, values: list, modified_by: str) -> None: + """ + Parameters: + values (list): the values. + """ + pass def __init__(self, data: dict = {}) -> None: # this is pretty self-explanatory # the key is a 4 letter key from the id3 standards like TITL + self.id3_attributes: Dict[str, list] = {} + self. # its a null byte for the later concatenation of text frames self.null_byte = "\x00" diff --git a/src/music_kraken/database/objects/song.py b/src/music_kraken/database/objects/song.py index 720771f..e3be420 100644 --- a/src/music_kraken/database/objects/song.py +++ b/src/music_kraken/database/objects/song.py @@ -208,18 +208,20 @@ class Song(DatabaseObject): self.metadata[ID3_MAPPING.FILE_WEBPAGE_URL.value] = source_obj.url def set_sources(self, source_list): + if source_list is None: + return + self._sources = source_list for source in self._sources: source.add_song(self) - # self.metadata[ID3_MAPPING.FILE_WEBPAGE_URL.value] = [s.url for s in self._sources] self.metadata.add_many_id3_metadata_obj(self._sources) def set_album(self, album): if album is None: return - self.metadata.add_many_id3_metadata_obj() + self.metadata.add_id3_metadata_obj(album) self._album = album def get_metadata(self): @@ -228,9 +230,6 @@ class Song(DatabaseObject): def has_isrc(self) -> bool: return self._isrc is not None - def add_source(self, source: Source): - pass - def get_artist_names(self) -> List[str]: return self.artist_names diff --git a/test.db b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