mirror of
https://github.com/beetbox/beets.git
synced 2025-12-25 10:05:13 +01:00
Merge pull request #917 from geigerzaehler/stats
Improvements for stats command
This commit is contained in:
commit
b227aabfee
1 changed files with 8 additions and 3 deletions
|
|
@ -1186,6 +1186,7 @@ def show_stats(lib, query, exact):
|
|||
total_items = 0
|
||||
artists = set()
|
||||
albums = set()
|
||||
album_artists = set()
|
||||
|
||||
for item in items:
|
||||
if exact:
|
||||
|
|
@ -1195,7 +1196,9 @@ def show_stats(lib, query, exact):
|
|||
total_time += item.length
|
||||
total_items += 1
|
||||
artists.add(item.artist)
|
||||
albums.add(item.album)
|
||||
album_artists.add(item.albumartist)
|
||||
if item.album_id:
|
||||
albums.add(item.album_id)
|
||||
|
||||
size_str = '' + ui.human_bytes(total_size)
|
||||
if exact:
|
||||
|
|
@ -1205,8 +1208,10 @@ def show_stats(lib, query, exact):
|
|||
Total time: {1} ({2:.2f} seconds)
|
||||
Total size: {3}
|
||||
Artists: {4}
|
||||
Albums: {5}""".format(total_items, ui.human_seconds(total_time), total_time,
|
||||
size_str, len(artists), len(albums)))
|
||||
Albums: {5}
|
||||
Album artists: {6}""".format(total_items, ui.human_seconds(total_time),
|
||||
total_time, size_str, len(artists), len(albums),
|
||||
len(album_artists)))
|
||||
|
||||
|
||||
def stats_func(lib, opts, args):
|
||||
|
|
|
|||
Loading…
Reference in a new issue