From 155732ab1a162f25baa4936e7389c61c1b6f4f31 Mon Sep 17 00:00:00 2001 From: Ruud Date: Mon, 2 Sep 2013 00:13:05 +0200 Subject: [PATCH] Rollback type remove --- couchpotato/core/media/movie/library/movie/main.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/couchpotato/core/media/movie/library/movie/main.py b/couchpotato/core/media/movie/library/movie/main.py index 98da582..be4b85e 100644 --- a/couchpotato/core/media/movie/library/movie/main.py +++ b/couchpotato/core/media/movie/library/movie/main.py @@ -21,20 +21,25 @@ class MovieLibraryPlugin(LibraryBase): addEvent('library.update.movie.release_date', self.updateReleaseDate) def add(self, attrs = {}, update_after = True): + # movies don't yet contain these, so lets make sure to set defaults + type = attrs.get('type', 'movie') primary_provider = attrs.get('primary_provider', 'imdb') db = get_session() - l = db.query(Library).filter_by(identifier = attrs.get('identifier')).first() + l = db.query(Library).filter_by(type = type, identifier = attrs.get('identifier')).first() if not l: status = fireEvent('status.get', 'needs_update', single = True) l = Library( + type = type, + primary_provider = primary_provider, year = attrs.get('year'), identifier = attrs.get('identifier'), plot = toUnicode(attrs.get('plot')), tagline = toUnicode(attrs.get('tagline')), status_id = status.get('id'), - info = {} + info = {}, + parent = None ) title = LibraryTitle(