Fix KeyError for librarysync

This commit is contained in:
tomkat83 2017-01-07 20:20:18 +01:00
parent e90f48cc8e
commit 0a2f1bc01b
2 changed files with 11 additions and 1 deletions

View file

@ -83,6 +83,16 @@ ITEMTYPE_FROM_PLEXTYPE = {
PLEX_TYPE_SONG: 'Music',
}
ITEMTYPE_FROM_KODITYPE = {
KODI_TYPE_MOVIE: 'Movies',
KODI_TYPE_SEASON: 'TVShows',
KODI_TYPE_EPISODE: 'TVShows',
KODI_TYPE_SHOW: 'TVShows',
KODI_TYPE_ARTIST: 'Music',
KODI_TYPE_ALBUM: 'Music',
KODI_TYPE_SONG: 'Music',
}
KODITYPE_FROM_PLEXTYPE = {
PLEX_TYPE_MOVIE: KODI_TYPE_MOVIE,
PLEX_TYPE_EPISODE: KODI_TYPE_EPISODE,

View file

@ -1666,7 +1666,7 @@ class LibrarySync(Thread):
# Now tell Kodi where we are
for item in items:
itemFkt = getattr(itemtypes,
PF.ITEMTYPE_FROM_PLEXTYPE[item['kodi_type']])
PF.ITEMTYPE_FROM_KODITYPE[item['kodi_type']])
with itemFkt() as Fkt:
Fkt.updatePlaystate(item)