mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-13 21:56:11 +00:00
Hotfix (#71)
* Fix typos * Indicate unicode dict * Fix artistid * Attempt to fix encoding
This commit is contained in:
parent
ba22e26c06
commit
85d054f33a
4 changed files with 12 additions and 8 deletions
|
@ -34,7 +34,7 @@ class Credentials(object):
|
||||||
if self.credentials is None:
|
if self.credentials is None:
|
||||||
try:
|
try:
|
||||||
with open(os.path.join(self.path, 'data.txt')) as infile:
|
with open(os.path.join(self.path, 'data.txt')) as infile:
|
||||||
self.credentials = json.load(infile)
|
self.credentials = json.load(unicode(infile))
|
||||||
|
|
||||||
except Exception as e: # File is either empty or missing
|
except Exception as e: # File is either empty or missing
|
||||||
log.warn(e)
|
log.warn(e)
|
||||||
|
@ -54,7 +54,7 @@ class Credentials(object):
|
||||||
self.credentials = data
|
self.credentials = data
|
||||||
# Set credentials to file
|
# Set credentials to file
|
||||||
with open(os.path.join(self.path, 'data.txt'), 'w') as outfile:
|
with open(os.path.join(self.path, 'data.txt'), 'w') as outfile:
|
||||||
json.dump(data, outfile, indent=4, ensure_ascii=False)
|
json.dump(unicode(data), outfile, indent=4, ensure_ascii=False)
|
||||||
else:
|
else:
|
||||||
self._clear()
|
self._clear()
|
||||||
|
|
||||||
|
|
|
@ -62,10 +62,11 @@ class Items(object):
|
||||||
@classmethod
|
@classmethod
|
||||||
def path_validation(cls, path):
|
def path_validation(cls, path):
|
||||||
# Verify if direct path is accessible or not
|
# Verify if direct path is accessible or not
|
||||||
|
verify_path = path
|
||||||
if not os.path.supports_unicode_filenames:
|
if not os.path.supports_unicode_filenames:
|
||||||
path = path.encode('utf-8')
|
verify_path = path.encode('utf-8')
|
||||||
|
|
||||||
if window('emby_pathverified') != "true" and not xbmcvfs.exists(path):
|
if window('emby_pathverified') != "true" and not xbmcvfs.exists(verify_path):
|
||||||
if dialog(type_="yesno",
|
if dialog(type_="yesno",
|
||||||
heading="{emby}",
|
heading="{emby}",
|
||||||
line1="%s %s. %s" % (lang(33047), path, lang(33048))):
|
line1="%s %s. %s" % (lang(33047), path, lang(33048))):
|
||||||
|
|
|
@ -746,8 +746,8 @@ class KodiItems(object):
|
||||||
tag_id = self.cursor.fetchone()[0] + 1
|
tag_id = self.cursor.fetchone()[0] + 1
|
||||||
|
|
||||||
query = "INSERT INTO tag(idTag, strTag) values(?, ?)"
|
query = "INSERT INTO tag(idTag, strTag) values(?, ?)"
|
||||||
self.cursor.execute(query, (tag_id, name))
|
self.cursor.execute(query, (tag_id, tag))
|
||||||
log.debug("Create idTag: %s name: %s", tag_id, name)
|
log.debug("Create idTag: %s name: %s", tag_id, tag)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
# Assign tag to item
|
# Assign tag to item
|
||||||
|
|
|
@ -528,8 +528,11 @@ class Music(Items):
|
||||||
artist_full = emby.getItem(artist_eid)
|
artist_full = emby.getItem(artist_eid)
|
||||||
self.add_updateArtist(artist_full)
|
self.add_updateArtist(artist_full)
|
||||||
artist_edb = emby_db.getItem_byId(artist_eid)
|
artist_edb = emby_db.getItem_byId(artist_eid)
|
||||||
artistid = artist_edb[0]
|
artistid = artist_edb[0] if artist_edb else None
|
||||||
finally:
|
except Exception:
|
||||||
|
artistid = None
|
||||||
|
|
||||||
|
if artistid:
|
||||||
# Link song to artist
|
# Link song to artist
|
||||||
self.kodi_db.link_song_artist(artistid, songid, index, artist_name)
|
self.kodi_db.link_song_artist(artistid, songid, index, artist_name)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue