Save MusicBrainz lookups in the database

This commit is contained in:
JonnyWong16
2019-10-06 15:16:19 -07:00
parent 6ff826bc3a
commit cba43f675a
2 changed files with 72 additions and 26 deletions

View File

@@ -751,6 +751,13 @@ def dbcheck():
'themoviedb_id INTEGER, themoviedb_url TEXT, themoviedb_json TEXT)'
)
# musicbrainz_lookup table :: This table keeps record of the MusicBrainz lookups
c_db.execute(
'CREATE TABLE IF NOT EXISTS musicbrainz_lookup (id INTEGER PRIMARY KEY AUTOINCREMENT, '
'rating_key INTEGER, musicbrainz_id INTEGER, musicbrainz_url TEXT, musicbrainz_type TEXT, '
'musicbrainz_json TEXT)'
)
# image_hash_lookup table :: This table keeps record of the image hash lookups
c_db.execute(
'CREATE TABLE IF NOT EXISTS image_hash_lookup (id INTEGER PRIMARY KEY AUTOINCREMENT, '
@@ -1928,6 +1935,9 @@ def dbcheck():
c_db.execute(
'CREATE UNIQUE INDEX IF NOT EXISTS idx_themoviedb_lookup ON themoviedb_lookup (rating_key)'
)
c_db.execute(
'CREATE UNIQUE INDEX IF NOT EXISTS idx_musicbrainz_lookup ON musicbrainz_lookup (rating_key)'
)
conn_db.commit()
c_db.close()