From 1c7d3972b581be5c6fdc2343670d7245536e0623 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 13 May 2012 18:41:22 +0200 Subject: [PATCH 1/2] Log found movie number --- couchpotato/core/plugins/scanner/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/couchpotato/core/plugins/scanner/main.py b/couchpotato/core/plugins/scanner/main.py index 9a5f85fc..136a1964 100644 --- a/couchpotato/core/plugins/scanner/main.py +++ b/couchpotato/core/plugins/scanner/main.py @@ -328,6 +328,10 @@ class Scanner(Plugin): # Clean up self.path_identifiers = {} + if len(processed_movies) > 0: + log.info('Found %s movies in the folder %s' % (len(processed_movies), folder)) + else: + log.debug('Found no movies in the folder %s' % (folder)) return processed_movies def getMetaData(self, group): From a71fb1a063e6db75b2ee12f5187241356ed07c2f Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 13 May 2012 21:52:55 +0200 Subject: [PATCH 2/2] Don't merge release_date, just overwrite --- couchpotato/core/plugins/library/main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/couchpotato/core/plugins/library/main.py b/couchpotato/core/plugins/library/main.py index 0d3d09e4..4cdc323f 100644 --- a/couchpotato/core/plugins/library/main.py +++ b/couchpotato/core/plugins/library/main.py @@ -1,7 +1,6 @@ from couchpotato import get_session from couchpotato.core.event import addEvent, fireEventAsync, fireEvent from couchpotato.core.helpers.encoding import toUnicode, simplifyString -from couchpotato.core.helpers.variable import mergeDicts from couchpotato.core.logger import CPLog from couchpotato.core.plugins.base import Plugin from couchpotato.core.settings.model import Library, LibraryTitle, File @@ -137,10 +136,12 @@ class LibraryPlugin(Plugin): db = get_session() library = db.query(Library).filter_by(identifier = identifier).first() + dates = library.info.get('release_date') - if library.info.get('release_date', {}).get('expires', 0) < time.time(): + if dates and dates.get('expires', 0) < time.time(): dates = fireEvent('movie.release_date', identifier = identifier, merge = True) - library.info = mergeDicts(library.info, {'release_date': dates}) + library.info['release_date'] = dates + library.info = library.info db.commit() dates = library.info.get('release_date', {})