Browse Source

Don't merge release_date, just overwrite

tags/build/2.0.0.pre1
Ruud 13 years ago
parent
commit
a71fb1a063
  1. 7
      couchpotato/core/plugins/library/main.py

7
couchpotato/core/plugins/library/main.py

@ -1,7 +1,6 @@
from couchpotato import get_session from couchpotato import get_session
from couchpotato.core.event import addEvent, fireEventAsync, fireEvent from couchpotato.core.event import addEvent, fireEventAsync, fireEvent
from couchpotato.core.helpers.encoding import toUnicode, simplifyString from couchpotato.core.helpers.encoding import toUnicode, simplifyString
from couchpotato.core.helpers.variable import mergeDicts
from couchpotato.core.logger import CPLog from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin from couchpotato.core.plugins.base import Plugin
from couchpotato.core.settings.model import Library, LibraryTitle, File from couchpotato.core.settings.model import Library, LibraryTitle, File
@ -137,10 +136,12 @@ class LibraryPlugin(Plugin):
db = get_session() db = get_session()
library = db.query(Library).filter_by(identifier = identifier).first() 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) 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() db.commit()
dates = library.info.get('release_date', {}) dates = library.info.get('release_date', {})

Loading…
Cancel
Save