More indicees for Plex DB

This commit is contained in:
croneter 2018-11-11 19:32:05 +01:00
parent ead799d38b
commit dfde9533d8

View file

@ -250,9 +250,16 @@ def initialize():
kodi_hash TEXT)
''')
# DB indicees for faster lookups
plexdb.cursor.execute('CREATE UNIQUE INDEX IF NOT EXISTS ix_movie_1 ON movie (plex_id)')
plexdb.cursor.execute('CREATE UNIQUE INDEX IF NOT EXISTS ix_show_1 ON show (plex_id)')
plexdb.cursor.execute('CREATE UNIQUE INDEX IF NOT EXISTS ix_season_1 ON season (plex_id)')
plexdb.cursor.execute('CREATE UNIQUE INDEX IF NOT EXISTS ix_episode_1 ON episode (plex_id)')
plexdb.cursor.execute('CREATE UNIQUE INDEX IF NOT EXISTS ix_artist_1 ON artist (plex_id)')
plexdb.cursor.execute('CREATE UNIQUE INDEX IF NOT EXISTS ix_album_1 ON album (plex_id)')
plexdb.cursor.execute('CREATE UNIQUE INDEX IF NOT EXISTS ix_track_1 ON track (plex_id)')
plexdb.cursor.execute('CREATE UNIQUE INDEX IF NOT EXISTS ix_playlists_1 ON playlists (plex_id)')
plexdb.cursor.execute('CREATE UNIQUE INDEX IF NOT EXISTS ix_playlists_2 ON playlists (kodi_path)')
plexdb.cursor.execute('CREATE UNIQUE INDEX IF NOT EXISTS ix_playlists_3 ON playlists (kodi_hash)')
def wipe():