Add Album Artist info for last added songs

This commit is contained in:
2017-10-17 00:23:57 +02:00
parent cb934b20b7
commit ab792b6e63
3 changed files with 7 additions and 2 deletions

View File

@@ -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) + '...';

View File

@@ -10,4 +10,5 @@ export class Album {
'Album Rating Computed': boolean;
'Play Count': number;
'Total Time': number;
'Album Artist': string;
}

View File

@@ -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):
"""