From 523a2eaf617dbb91259fab5ed26cf70aa40fdd30 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Sat, 4 Jun 2016 14:19:55 +0200 Subject: [PATCH] Fix filename changes not being recognized - Fixes #26, finally! --- resources/lib/itemtypes.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/resources/lib/itemtypes.py b/resources/lib/itemtypes.py index 970738ca..cbde0132 100644 --- a/resources/lib/itemtypes.py +++ b/resources/lib/itemtypes.py @@ -440,11 +440,6 @@ class Movies(Items): filename = "%s?%s" % (path, urllib.urlencode(params)) playurl = filename - # Even if the item is only updated, the file may have been moved or updated. - # In the worst case we get exactly the same values as we had before. - pathid = self.kodi_db.addPath(path) - fileid = self.kodi_db.addFile(filename, pathid) - # movie table: # c22 - playurl # c23 - pathid @@ -473,6 +468,10 @@ class Movies(Items): ##### OR ADD THE MOVIE ##### else: self.logMsg("ADD movie itemid: %s - Title: %s" % (itemid, title), 1) + # Add path + pathid = self.kodi_db.addPath(path) + # Add the file + fileid = self.kodi_db.addFile(filename, pathid) # Create the movie entry query = (