From 515aafe112ddc6b532cf8dd428a71cf5cb01b8b4 Mon Sep 17 00:00:00 2001 From: Jason Mehring Date: Fri, 13 Sep 2013 22:02:22 -0400 Subject: [PATCH] bug fixes for add show --- couchpotato/core/media/show/_base/main.py | 5 +++++ couchpotato/core/media/show/library/episode/main.py | 3 +-- couchpotato/core/media/show/library/season/main.py | 5 +---- couchpotato/core/media/show/library/show/main.py | 1 - 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/couchpotato/core/media/show/_base/main.py b/couchpotato/core/media/show/_base/main.py index 38077e67..b1cbe66e 100644 --- a/couchpotato/core/media/show/_base/main.py +++ b/couchpotato/core/media/show/_base/main.py @@ -141,6 +141,7 @@ class ShowBase(MediaBase): single_season['title'] = single_season.get('original_title', None) single_season['identifier'] = season_id single_season['parent_identifier'] = identifier + log.info("Adding Season %s" % season_id) s = self.addToDatabase(params = single_season, type = "season") episode_params = {'season_identifier': season_id} @@ -171,6 +172,10 @@ class ShowBase(MediaBase): single_episode['title'] = single_episode.get('original_title', None) single_episode['identifier'] = episode_id single_episode['parent_identifier'] = single_season['identifier'] + log.info("Adding [%sx%s] %s - %s" % (season_id, + episode_number, + params['title'], + single_episode.get('original_title', ''))) e = self.addToDatabase(params = single_episode, type = "episode") return parent diff --git a/couchpotato/core/media/show/library/episode/main.py b/couchpotato/core/media/show/library/episode/main.py index bc2a6060..e8997209 100644 --- a/couchpotato/core/media/show/library/episode/main.py +++ b/couchpotato/core/media/show/library/episode/main.py @@ -157,8 +157,7 @@ class EpisodeLibraryPlugin(LibraryBase): except: log.debug('Failed to attach to library: %s', traceback.format_exc()) - library_dict = library.to_dict(self.default_dict) - + library_dict = library.to_dict(self.default_dict) db.expire_all() return library_dict diff --git a/couchpotato/core/media/show/library/season/main.py b/couchpotato/core/media/show/library/season/main.py index 3912c5f0..75f19d5a 100644 --- a/couchpotato/core/media/show/library/season/main.py +++ b/couchpotato/core/media/show/library/season/main.py @@ -63,7 +63,6 @@ class SeasonLibraryPlugin(LibraryBase): handle('library.update.season', identifier = l.identifier, default_title = toUnicode(attrs.get('title', ''))) library_dict = l.to_dict(self.default_dict) - db.expire_all() return library_dict @@ -148,13 +147,11 @@ class SeasonLibraryPlugin(LibraryBase): file_obj = db.query(File).filter_by(id = file_obj.get('id')).one() library.files.append(file_obj) db.commit() - break except: log.debug('Failed to attach to library: %s', traceback.format_exc()) - library_dict = library.to_dict(self.default_dict) - + library_dict = library.to_dict(self.default_dict) db.expire_all() return library_dict diff --git a/couchpotato/core/media/show/library/show/main.py b/couchpotato/core/media/show/library/show/main.py index 141a9e0f..944ab96a 100644 --- a/couchpotato/core/media/show/library/show/main.py +++ b/couchpotato/core/media/show/library/show/main.py @@ -57,7 +57,6 @@ class ShowLibraryPlugin(LibraryBase): handle('library.update.show', identifier = l.identifier, default_title = toUnicode(attrs.get('title', ''))) library_dict = l.to_dict(self.default_dict) - db.expire_all() return library_dict