From 30adb5bd27906127be09041ccf767b6e9391dfa7 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Wed, 26 Oct 2016 21:06:16 +0200 Subject: [PATCH] Optimize code --- resources/lib/itemtypes.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/resources/lib/itemtypes.py b/resources/lib/itemtypes.py index c3faa0f3..695cf88c 100644 --- a/resources/lib/itemtypes.py +++ b/resources/lib/itemtypes.py @@ -462,11 +462,6 @@ class Movies(Items): mpaa, genre, director, title, studio, trailer, country, playurl, pathid, fileid, movieid)) - # Update the checksum in emby table - # emby_db.updateReference(itemid, checksum) - # Add reference is idempotent; the call here updates also fileid and pathid when item - # is moved or renamed - emby_db.addReference(itemid, movieid, "Movie", "movie", fileid, pathid, None, checksum, viewid) ##### OR ADD THE MOVIE ##### else: @@ -486,8 +481,11 @@ class Movies(Items): rating, writer, year, imdb, sorttitle, runtime, mpaa, genre, director, title, studio, trailer, country, playurl, pathid)) - # Create the reference in emby table - emby_db.addReference(itemid, movieid, "Movie", "movie", fileid, pathid, None, checksum, viewid) + # Create or update the reference in emby table Add reference is + # idempotent; the call here updates also fileid and pathid when item is + # moved or renamed + emby_db.addReference(itemid, movieid, "Movie", "movie", fileid, pathid, + None, checksum, viewid) # Update the path query = ' '.join((