From 7230428a311691aabadfea42036e78b6419f083b Mon Sep 17 00:00:00 2001 From: Ade Date: Sun, 10 Jun 2018 10:37:59 +1200 Subject: [PATCH] Speed up albumPage --- data/interfaces/default/album.html | 2 +- headphones/__init__.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/data/interfaces/default/album.html b/data/interfaces/default/album.html index 13223743..327d824e 100644 --- a/data/interfaces/default/album.html +++ b/data/interfaces/default/album.html @@ -324,7 +324,7 @@ if (++x === 10) { clearInterval(refreshInterval); } - var sts = $("#artistname").text(); + var sts = $("#artistname").text().trim(); if (wasLoading == true || sts == "Loading"){ location.reload(); $('#albumnamespinner').remove() diff --git a/headphones/__init__.py b/headphones/__init__.py index 2d622766..373bbb4b 100644 --- a/headphones/__init__.py +++ b/headphones/__init__.py @@ -420,6 +420,13 @@ def dbcheck(): c.execute( 'CREATE INDEX IF NOT EXISTS tracks_artistid ON tracks(ArtistID ASC)') + # Speed up album page + c.execute('CREATE INDEX IF NOT EXISTS have_matched ON have(Matched ASC)') + c.execute('CREATE INDEX IF NOT EXISTS allalbums_albumid ON allalbums(AlbumID ASC)') + c.execute('CREATE INDEX IF NOT EXISTS alltracks_albumid ON alltracks(AlbumID ASC)') + c.execute('CREATE INDEX IF NOT EXISTS releases_albumid ON releases(ReleaseGroupID ASC)') + c.execute('CREATE INDEX IF NOT EXISTS descriptions_albumid ON descriptions(ReleaseGroupID ASC)') + try: c.execute('SELECT IncludeExtras from artists') except sqlite3.OperationalError: