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')