From 97f9258de94cef58053e2c301c9d4927827cafca Mon Sep 17 00:00:00 2001 From: RemixDev Date: Thu, 29 Oct 2020 11:23:42 +0100 Subject: [PATCH] Added SOURCE and SOURCEID tags This adds #81 --- deemix/app/settings.py | 1 + deemix/utils/taggers.py | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/deemix/app/settings.py b/deemix/app/settings.py index d2bae7d..f13247c 100644 --- a/deemix/app/settings.py +++ b/deemix/app/settings.py @@ -117,6 +117,7 @@ DEFAULT_SETTINGS = { "copyright": False, "composer": False, "involvedPeople": False, + "source": False, "savePlaylistAsCompilation": False, "useNullSeparator": False, "saveID3v1": True, diff --git a/deemix/utils/taggers.py b/deemix/utils/taggers.py index e1f2bf3..e764b37 100644 --- a/deemix/utils/taggers.py +++ b/deemix/utils/taggers.py @@ -94,6 +94,10 @@ def tagID3(stream, track, save): if save['savePlaylistAsCompilation'] and track.playlist or track.album['recordType'] == "compile": tag.add(TCMP(text="1")) + if save['source']: + tag.add(TXXX(desc="SOURCE", text='Deezer')) + tag.add(TXXX(desc="SOURCEID", text=str(track.id))) + if save['cover'] and track.album['picPath']: descEncoding = Encoding.LATIN1 @@ -191,6 +195,10 @@ def tagFLAC(stream, track, save): if save['savePlaylistAsCompilation'] and track.playlist or track.album['recordType'] == "compile": tag["COMPILATION"] = "1" + if save['source']: + tag["SOURCE"] = 'Deezer' + tag["SOURCEID"] = str(track.id) + if save['cover'] and track.album['picPath']: image = Picture() image.type = PictureType.COVER_FRONT