From f9b0a5efb942dd7577a08db6fc5f58b9e529d778 Mon Sep 17 00:00:00 2001 From: Jens Rogier Date: Thu, 17 Apr 2014 19:41:40 +0200 Subject: [PATCH] Fixed little bug where the trackcount on the index page was screwing up when choosing different release. --- headphones/albumswitcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headphones/albumswitcher.py b/headphones/albumswitcher.py index 377d32af..e9febfd4 100644 --- a/headphones/albumswitcher.py +++ b/headphones/albumswitcher.py @@ -71,7 +71,7 @@ def switch(AlbumID, ReleaseID): myDB.action('UPDATE albums SET Status=? WHERE AlbumID=?', ['Downloaded', AlbumID]) # Update have track counts on index - totaltracks = len(myDB.select('SELECT TrackTitle from tracks WHERE ArtistID=?', [newalbumdata['ArtistID']])) + totaltracks = len(myDB.select('SELECT TrackTitle from tracks WHERE ArtistID=? AND AlbumID IN (SELECT AlbumID FROM albums WHERE Status != "Ignored")', [newalbumdata['ArtistID']])) havetracks = len(myDB.select('SELECT TrackTitle from tracks WHERE ArtistID=? AND Location IS NOT NULL', [newalbumdata['ArtistID']])) + len(myDB.select('SELECT TrackTitle from have WHERE ArtistName like ?', [newalbumdata['ArtistID']])) controlValueDict = {"ArtistID": newalbumdata['ArtistID']}