From a8bf1ad921e870e742ce9d39e0cb71f1e79e8c32 Mon Sep 17 00:00:00 2001 From: Lars Noack Date: Mon, 9 Jan 2023 14:21:49 +0100 Subject: [PATCH] added mapping enum --- src/music_kraken/database/objects/song.py | 3 +- src/music_kraken/tagging/id3.py | 61 +++++++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 src/music_kraken/tagging/id3.py diff --git a/src/music_kraken/database/objects/song.py b/src/music_kraken/database/objects/song.py index dae6071..8c4c981 100644 --- a/src/music_kraken/database/objects/song.py +++ b/src/music_kraken/database/objects/song.py @@ -171,7 +171,8 @@ class Song(DatabaseObject): self.artist_names = artist_names self.tracksort: int | None = tracksort - self.metadata = Metadata(data=metadata) + # self.metadata = Metadata(data=metadata) + self.metadata = None if sources is None: sources = [] diff --git a/src/music_kraken/tagging/id3.py b/src/music_kraken/tagging/id3.py new file mode 100644 index 0000000..fdab85a --- /dev/null +++ b/src/music_kraken/tagging/id3.py @@ -0,0 +1,61 @@ +from enum import Enum + + +class Mapping(Enum): + DATE = "TYER" + UNSYNCED_LYRICS = "USLT" + TRACKNUMBER = "TRCK" + TOTALTRACKS = "TRCK" # Stored in the same frame with TRACKNUMBER, separated by '/': e.g. '4/9'. + TITLE = "TIT2" + TITLESORTORDER = "TSOT" + ENCODING_SETTINGS = "TSSE" + SUBTITLE = "TIT3" + SET_SUBTITLE = "TSST" + RELEASE_DATE = "TDRL" + RECORDING_DATES = "TXXX" + PUBLISHER_URL = "WPUB" + PUBLISHER = "TPUB" + RATING = "POPM" + PAYMEMT_URL = "WPAY" + DISCNUMBER = "TPOS" + MOVEMENT_COUNT = "MVIN" + TOTALDISCS = "TPOS" + ORIGINAL_RELEASE_DATE = "TDOR" + ORIGINAL_ARTIST = "TOPE" + ORIGINAL_ALBUM = "TOAL" + INTERNET_RADIO_WEBPAGE_URL = "WORS" + SOURCE_WEBPAGE_URL = "WOAS" + FILE_WEBPAGE_URL = "WOAF" + ARTIST_WEBPAGE_URL = "WOAR" + MOVEMENT_INDEX = "MVIN" + MOVEMENT_NAME = "MVNM" + MEDIA_TYPE = "TMED" + LYRICIST = "TEXT" + WRITER = "TEXT" + ARTIST = "TPE1" + LANGUAGE = "TLAN" + ITUNESCOMPILATION = "TCMP" + ISRC = "TSRC" + REMIXED_BY = "TPE4" + RADIO_STATION_OWNER = "TRSO" + RADIO_STATION = "TRSN" + INITIAL_KEY = "TKEY" + OWNER = "TOWN" + ENCODED_BY = "TENC" + COPYRIGHT_URL = "WCOP" + COPYRIGHT = "TCOP" + GENRE = "TCON" + GROUPING = "TIT1" + CONDUCTOR = "TPE3" + COMPOSERSORTORDER = "TSOC" + COMPOSER = "TCOM" + COMMERCIAL_INFORMATION_URL = "WCOM" + COMMENT = "COMM" + BPM = "TBPM" + ALBUM_ARTIST = "TPE2" + BAND = "TPE2" + ARTISTSORTORDER = "TSOP" + ALBUM = "TALB" + ALBUMSORTORDER = "TSOA" + ALBUMARTISTSORTORDER = "TSO2" +