diff --git a/dashboard/src/app/dashboard.component.ts b/dashboard/src/app/dashboard.component.ts index 29ec069..fb958a3 100644 --- a/dashboard/src/app/dashboard.component.ts +++ b/dashboard/src/app/dashboard.component.ts @@ -76,12 +76,12 @@ export class DashboardComponent implements OnInit { // Search good artist by track count albums.forEach(album => { if (album['Track Count'] === albumBucket.doc_count) { - this.albumArtists[album.Name] = album.Artist.toString(); + this.albumArtists[album.Name] = album['Album Artist'].toString(); } }); } else { // Just one artistresult for album name - this.albumArtists[albums[0].Name] = albums[0].Artist.toString(); + this.albumArtists[albums[0].Name] = albums[0]['Album Artist'] ? albums[0]['Album Artist'].toString() : albums[0].Artist.toString(); } if (this.albumArtists[albums[0].Name].length > 50) { this.albumArtists[albums[0].Name] = this.albumArtists[albums[0].Name].substring(0, 50) + '...'; diff --git a/dashboard/src/app/object/album.ts b/dashboard/src/app/object/album.ts index ae7b88b..7a4af51 100644 --- a/dashboard/src/app/object/album.ts +++ b/dashboard/src/app/object/album.ts @@ -10,4 +10,5 @@ export class Album { 'Album Rating Computed': boolean; 'Play Count': number; 'Total Time': number; + 'Album Artist': string; } diff --git a/iTunesParser.py b/iTunesParser.py index 761508d..f1b27bf 100644 --- a/iTunesParser.py +++ b/iTunesParser.py @@ -187,6 +187,7 @@ class ITunesParser: 'Rating': 0, 'Genre': set(), 'Artist': set(), + # 'Album Artist': '', 'Total Time': 0 } @@ -215,6 +216,9 @@ class ITunesParser: self._albums[akey]['Album Rating'] = track['Album Rating'] self._albums[akey]['Album Rating Computed'] = True + if 'Album Artist' in track: + self._albums[akey]['Album Artist'] = track['Album Artist'] + @classmethod def calc_rating(cls, added_value, current_rating, count): """