Add time for Album + pipe to convert Ms

This commit is contained in:
2017-05-14 01:23:01 +02:00
parent bf274e08d6
commit 8cb2d91af0
8 changed files with 57 additions and 47 deletions

View File

@@ -184,7 +184,8 @@ class ITunesParser:
'Play Count': 0,
'Rating': 0,
'Genre': set(),
'Artist': set()
'Artist': set(),
'Total Time': 0
}
# Compute information
@@ -193,9 +194,12 @@ class ITunesParser:
rating = track['Rating'] if 'Rating' in track else 0
rating = self.calc_rating(rating, self._albums[akey]['Rating'], self._albums[akey]['Track Count'])
total_time = track['Total Time'] if 'Total Time' in track else 0
self._albums[akey]['Track Count'] += 1
self._albums[akey]['Rating'] = rating
self._albums[akey]['Play Count'] += play_count
self._albums[akey]['Total Time'] += total_time
if 'Genre' in track:
# Split up the Genres