From a71fb1a063e6db75b2ee12f5187241356ed07c2f Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 13 May 2012 21:52:55 +0200 Subject: [PATCH] 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', {})