From 2d2c84b505d120939ccc3923cf481da73a0960b7 Mon Sep 17 00:00:00 2001 From: Thomas Scholtes Date: Mon, 25 Aug 2014 11:34:40 +0200 Subject: [PATCH] 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: