mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Remove emby references from music database
This commit is contained in:
parent
a7c96577cd
commit
e96f32308b
2 changed files with 10 additions and 1 deletions
|
@ -63,6 +63,15 @@ class Database(object):
|
||||||
jellyfin_tables(self.cursor)
|
jellyfin_tables(self.cursor)
|
||||||
self.conn.commit()
|
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
|
return self
|
||||||
|
|
||||||
def _get_database(self, path, silent=False):
|
def _get_database(self, path, silent=False):
|
||||||
|
|
|
@ -329,7 +329,7 @@ class Music(KodiDb):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
server_address = self.server.auth.get_server_info(self.server.auth.server_id)['address']
|
server_address = self.server.auth.get_server_info(self.server.auth.server_id)['address']
|
||||||
obj['Path'] = "%s/emby/Audio/%s/" % (server_address, obj['Id'])
|
obj['Path'] = "%s/Audio/%s/" % (server_address, obj['Id'])
|
||||||
obj['Filename'] = "stream.%s?static=true" % obj['Container']
|
obj['Filename'] = "stream.%s?static=true" % obj['Container']
|
||||||
|
|
||||||
def song_artist_discography(self, obj):
|
def song_artist_discography(self, obj):
|
||||||
|
|
Loading…
Reference in a new issue