From dc22bb006d8b076c16cc5784712ee0b72a03276d Mon Sep 17 00:00:00 2001 From: Ade Date: Tue, 8 Jan 2019 21:09:41 +1300 Subject: [PATCH] Hotfix index creation from develop Fixes #3175 --- headphones/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/headphones/__init__.py b/headphones/__init__.py index 826658e2..9a0c4fc5 100644 --- a/headphones/__init__.py +++ b/headphones/__init__.py @@ -443,10 +443,9 @@ def dbcheck(): # General speed up c.execute('CREATE INDEX IF NOT EXISTS artist_artistsortname ON artists(ArtistSortName COLLATE NOCASE ASC)') - exists = c.execute('SELECT * FROM pragma_index_info("have_matched_artist_album")').fetchone() - if not exists: - c.execute('CREATE INDEX have_matched_artist_album ON have(Matched ASC, ArtistName COLLATE NOCASE ASC, AlbumTitle COLLATE NOCASE ASC)') - c.execute('DROP INDEX IF EXISTS have_matched') + c.execute( + """CREATE INDEX IF NOT EXISTS have_matched_artist_album ON have(Matched ASC, ArtistName COLLATE NOCASE ASC, AlbumTitle COLLATE NOCASE ASC)""") + c.execute('DROP INDEX IF EXISTS have_matched') try: c.execute('SELECT IncludeExtras from artists')