From 9e2b6d02531801d12431073fff9d6f2c167a2d57 Mon Sep 17 00:00:00 2001 From: Thomas Scholtes Date: Mon, 25 Aug 2014 11:33:10 +0200 Subject: [PATCH 1/2] Show album artist stats See #855 --- beets/ui/commands.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 0e8329d62..473b950e3 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -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,6 +1196,7 @@ def show_stats(lib, query, exact): total_time += item.length total_items += 1 artists.add(item.artist) + album_artists.add(item.albumartist) albums.add(item.album) size_str = '' + ui.human_bytes(total_size) @@ -1205,8 +1207,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): From 2d2c84b505d120939ccc3923cf481da73a0960b7 Mon Sep 17 00:00:00 2001 From: Thomas Scholtes Date: Mon, 25 Aug 2014 11:34:40 +0200 Subject: [PATCH 2/2] Stats only count albums in the database Items might have the `album` field set without belonging to an album in the beets database. We only count the albums that are represented in the database. --- beets/ui/commands.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 473b950e3..e3d0e4253 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -1197,7 +1197,8 @@ def show_stats(lib, query, exact): total_items += 1 artists.add(item.artist) album_artists.add(item.albumartist) - albums.add(item.album) + if item.album_id: + albums.add(item.album_id) size_str = '' + ui.human_bytes(total_size) if exact: