API: Added option to inject genre tag from external sources for tracks

This commit is contained in:
RemixDev 2021-09-21 09:01:30 +02:00
parent e61a9aa626
commit 4e16f14ffc

View file

@ -155,6 +155,9 @@ class Track:
if self.album.date and not self.date: self.date = self.album.date if self.album.date and not self.date: self.date = self.album.date
if not self.album.discTotal: self.album.discTotal = albumAPI_gw.get('NUMBER_DISK', "1") if not self.album.discTotal: self.album.discTotal = albumAPI_gw.get('NUMBER_DISK', "1")
if not self.copyright: self.copyright = albumAPI_gw['COPYRIGHT'] if not self.copyright: self.copyright = albumAPI_gw['COPYRIGHT']
if 'GENRES' in trackAPI_gw:
for genre in trackAPI_gw['GENRES']:
if genre not in self.album.genre: self.album.genre.push(genre)
self.parseTrack(trackAPI) self.parseTrack(trackAPI)
# Remove unwanted charaters in track name # Remove unwanted charaters in track name