Remove emby references from music database

This commit is contained in:
mcarlton00 2019-12-14 11:42:39 -05:00
commit e96f32308b
2 changed files with 10 additions and 1 deletions

View file

@ -63,6 +63,15 @@ class Database(object):
jellyfin_tables(self.cursor)
self.conn.commit()
# Migration for #162
if self.db_file == 'music':
query = self.conn.execute('SELECT * FROM path WHERE strPath LIKE "%/emby/%"')
contents = query.fetchall()
if contents:
for item in contents:
newPath = item[1].replace('/emby/', '/')
self.conn.execute('UPDATE path SET strPath = "{}" WHERE idPath = "{}"'.format(newPath, item[0]))
return self
def _get_database(self, path, silent=False):