From b5093eb6be8b8eed40ae6770a62c07fe78c9dd8b Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 20 Dec 2020 16:02:54 +0100 Subject: [PATCH] Music: replace album's year with release date --- resources/lib/itemtypes/music.py | 15 ++++++++++++--- resources/lib/kodi_db/music.py | 16 ++++++++++------ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/resources/lib/itemtypes/music.py b/resources/lib/itemtypes/music.py index 2b99140d..15a5a5c1 100644 --- a/resources/lib/itemtypes/music.py +++ b/resources/lib/itemtypes/music.py @@ -290,7 +290,10 @@ class Album(MusicMixin, ItemBase): musicBrainzId, api.artist_name(), genre, - api.year(), + api.premiere_date(), + # TODO: as soon as Plex supports the original + # release date (Kodi: strOrigReleaseDate) + api.premiere_date(), compilation, api.plot(), thumb, @@ -308,7 +311,10 @@ class Album(MusicMixin, ItemBase): musicBrainzId, api.artist_name(), genre, - api.year(), + api.premiere_date(), + # TODO: as soon as Plex supports the original + # release date (Kodi: strOrigReleaseDate) + api.premiere_date(), compilation, api.plot(), thumb, @@ -402,7 +408,10 @@ class Song(MusicMixin, ItemBase): None, None, genre, - api.year(), + api.premiere_date(), + # TODO: as soon as Plex supports the original + # release date (Kodi: strOrigReleaseDate) + api.premiere_date(), None, None, None, diff --git a/resources/lib/kodi_db/music.py b/resources/lib/kodi_db/music.py index 43bbcbbd..e64cc68d 100644 --- a/resources/lib/kodi_db/music.py +++ b/resources/lib/kodi_db/music.py @@ -192,7 +192,8 @@ class KodiMusicDB(common.KodiDBBase): strMusicBrainzAlbumID, strArtistDisp, strGenres, - iYear, + strReleaseDate, + strOrigReleaseDate, bCompilation, strReview, strImage, @@ -200,7 +201,7 @@ class KodiMusicDB(common.KodiDBBase): iUserrating, lastScraped, strReleaseType) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ''', (args)) else: args = list(args) @@ -212,14 +213,15 @@ class KodiMusicDB(common.KodiDBBase): strMusicBrainzAlbumID, strArtistDisp, strGenres, - iYear, + strReleaseDate, + strOrigReleaseDate, bCompilation, strReview, strLabel, iUserrating, lastScraped, strReleaseType) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ''', (args)) @db.catch_operationalerrors @@ -231,7 +233,8 @@ class KodiMusicDB(common.KodiDBBase): strMusicBrainzAlbumID = ?, strArtistDisp = ?, strGenres = ?, - iYear = ?, + strReleaseDate = ?, + strOrigReleaseDate = ?, bCompilation = ?, strReview = ?, strImage = ?, @@ -250,7 +253,8 @@ class KodiMusicDB(common.KodiDBBase): strMusicBrainzAlbumID = ?, strArtistDisp = ?, strGenres = ?, - iYear = ?, + strReleaseDate = ?, + strOrigReleaseDate = ?, bCompilation = ?, strReview = ?, strLabel = ?,