Add Album Artist info for last added songs
This commit is contained in:
@@ -76,12 +76,12 @@ export class DashboardComponent implements OnInit {
|
|||||||
// Search good artist by track count
|
// Search good artist by track count
|
||||||
albums.forEach(album => {
|
albums.forEach(album => {
|
||||||
if (album['Track Count'] === albumBucket.doc_count) {
|
if (album['Track Count'] === albumBucket.doc_count) {
|
||||||
this.albumArtists[album.Name] = album.Artist.toString();
|
this.albumArtists[album.Name] = album['Album Artist'].toString();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// Just one artistresult for album name
|
// 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) {
|
if (this.albumArtists[albums[0].Name].length > 50) {
|
||||||
this.albumArtists[albums[0].Name] = this.albumArtists[albums[0].Name].substring(0, 50) + '...';
|
this.albumArtists[albums[0].Name] = this.albumArtists[albums[0].Name].substring(0, 50) + '...';
|
||||||
|
|||||||
@@ -10,4 +10,5 @@ export class Album {
|
|||||||
'Album Rating Computed': boolean;
|
'Album Rating Computed': boolean;
|
||||||
'Play Count': number;
|
'Play Count': number;
|
||||||
'Total Time': number;
|
'Total Time': number;
|
||||||
|
'Album Artist': string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -187,6 +187,7 @@ class ITunesParser:
|
|||||||
'Rating': 0,
|
'Rating': 0,
|
||||||
'Genre': set(),
|
'Genre': set(),
|
||||||
'Artist': set(),
|
'Artist': set(),
|
||||||
|
# 'Album Artist': '',
|
||||||
'Total Time': 0
|
'Total Time': 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,6 +216,9 @@ class ITunesParser:
|
|||||||
self._albums[akey]['Album Rating'] = track['Album Rating']
|
self._albums[akey]['Album Rating'] = track['Album Rating']
|
||||||
self._albums[akey]['Album Rating Computed'] = True
|
self._albums[akey]['Album Rating Computed'] = True
|
||||||
|
|
||||||
|
if 'Album Artist' in track:
|
||||||
|
self._albums[akey]['Album Artist'] = track['Album Artist']
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def calc_rating(cls, added_value, current_rating, count):
|
def calc_rating(cls, added_value, current_rating, count):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user