From 22f71efaf50a044842a80b360f9bfed520a2a8a8 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Mon, 4 Jan 2016 21:48:30 -0600 Subject: [PATCH 1/3] Fix view order bug Make sure we get the default grouped view and not a view, when we are looking at grouped folders. --- resources/lib/librarysync.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/lib/librarysync.py b/resources/lib/librarysync.py index 35eb26b3..102c7b2b 100644 --- a/resources/lib/librarysync.py +++ b/resources/lib/librarysync.py @@ -357,8 +357,10 @@ class LibrarySync(threading.Thread): if folderid in groupedFolders: # Media folders are grouped into userview for grouped_view in grouped_views: + # This is only reserved for the detection or grouped views if (grouped_view['Type'] == "UserView" and - grouped_view.get('CollectionType') == mediatype): + grouped_view.get('CollectionType') == mediatype and + grouped_view['Id'] not in grouped_view['Path']): # Take the name of the userview foldername = grouped_view['Name'] break From 2c7a0c0b653051144ff5cb4237830e42e8ca2ccd Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Mon, 4 Jan 2016 21:58:45 -0600 Subject: [PATCH 2/3] Define the music cursor Make sure we use the proper cursor for music when using the incremental sync. Fix for artist table not found database error. --- resources/lib/itemtypes.py | 21 +++++++++++---------- resources/lib/librarysync.py | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/resources/lib/itemtypes.py b/resources/lib/itemtypes.py index 23f99e52..ec831f12 100644 --- a/resources/lib/itemtypes.py +++ b/resources/lib/itemtypes.py @@ -1876,9 +1876,10 @@ class TVShows(Items): class Music(Items): - def __init__(self, embycursor, kodicursor): + def __init__(self, embycursor, musiccursor): - Items.__init__(self, embycursor, kodicursor) + Items.__init__(self, embycursor, musiccursor) + self.musiccursor = musiccursor self.directstream = utils.settings('streamMusic') == "true" self.userid = utils.window('emby_currUser') @@ -1935,7 +1936,7 @@ class Music(Items): def add_updateArtist(self, item, artisttype="MusicArtist"): # Process a single artist kodiversion = self.kodiversion - kodicursor = self.kodicursor + kodicursor = self.musiccursor emby_db = self.emby_db kodi_db = self.kodi_db artwork = self.artwork @@ -2018,7 +2019,7 @@ class Music(Items): # Process a single artist emby = self.emby kodiversion = self.kodiversion - kodicursor = self.kodicursor + kodicursor = self.musiccursor emby_db = self.emby_db kodi_db = self.kodi_db artwork = self.artwork @@ -2176,7 +2177,7 @@ class Music(Items): def add_updateSong(self, item): # Process single song kodiversion = self.kodiversion - kodicursor = self.kodicursor + kodicursor = self.musiccursor emby_db = self.emby_db kodi_db = self.kodi_db artwork = self.artwork @@ -2425,7 +2426,7 @@ class Music(Items): def updateUserdata(self, item): # This updates: Favorite, LastPlayedDate, Playcount, PlaybackPositionTicks # Poster with progress bar - kodicursor = self.kodicursor + kodicursor = self.musiccursor emby_db = self.emby_db kodi_db = self.kodi_db API = api.API(item) @@ -2464,7 +2465,7 @@ class Music(Items): def remove(self, itemid): # Remove kodiid, fileid, pathid, emby reference emby_db = self.emby_db - kodicursor = self.kodicursor + kodicursor = self.musiccursor artwork = self.artwork emby_dbitem = emby_db.getItem_byId(itemid) @@ -2529,7 +2530,7 @@ class Music(Items): def removeSong(self, kodiid): - kodicursor = self.kodicursor + kodicursor = self.musiccursor artwork = self.artwork artwork.deleteArtwork(kodiid, "song", kodicursor) @@ -2537,7 +2538,7 @@ class Music(Items): def removeAlbum(self, kodiid): - kodicursor = self.kodicursor + kodicursor = self.musiccursor artwork = self.artwork artwork.deleteArtwork(kodiid, "album", kodicursor) @@ -2545,7 +2546,7 @@ class Music(Items): def removeArtist(self, kodiid): - kodicursor = self.kodicursor + kodicursor = self.musiccursor artwork = self.artwork artwork.deleteArtwork(kodiid, "artist", kodicursor) diff --git a/resources/lib/librarysync.py b/resources/lib/librarysync.py index 102c7b2b..aba8e875 100644 --- a/resources/lib/librarysync.py +++ b/resources/lib/librarysync.py @@ -357,7 +357,7 @@ class LibrarySync(threading.Thread): if folderid in groupedFolders: # Media folders are grouped into userview for grouped_view in grouped_views: - # This is only reserved for the detection or grouped views + # This is only reserved for the detection of grouped views if (grouped_view['Type'] == "UserView" and grouped_view.get('CollectionType') == mediatype and grouped_view['Id'] not in grouped_view['Path']): From ade63ae22fb665ea7d9686e923a776c05ca100ba Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Mon, 4 Jan 2016 23:06:47 -0600 Subject: [PATCH 3/3] Fix typo and remove default value for network creds --- resources/lib/utils.py | 2 +- resources/lib/videonodes.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/lib/utils.py b/resources/lib/utils.py index 3c2df45a..aca6b790 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -394,7 +394,7 @@ def passwordsXML(): line1= ( "Input the server name or IP address as indicated in your emby library paths. " 'For example, the server name: \\\\SERVER-PC\\path\\ is "SERVER-PC".')) - server = dialog.input("Enter the server name or IP address", settings('ipaddress')) + server = dialog.input("Enter the server name or IP address") if not server: return diff --git a/resources/lib/videonodes.py b/resources/lib/videonodes.py index 8a20c886..8cb20d64 100644 --- a/resources/lib/videonodes.py +++ b/resources/lib/videonodes.py @@ -73,8 +73,8 @@ class VideoNodes(object): # Verify the video directory if not xbmcvfs.exists(path): shutil.copytree( - src=xbmc.translatePath("special://xbmc/system/library/video/").decode('utf-8'), - dst=xbmc.translatePath("special://profile/library/video/").decode('utf-8')) + src=xbmc.translatePath("special://xbmc/system/library/video").decode('utf-8'), + dst=xbmc.translatePath("special://profile/library/video").decode('utf-8')) xbmcvfs.exists(path) # Create the node directory