bug fixes for add show
This commit is contained in:
@@ -141,6 +141,7 @@ class ShowBase(MediaBase):
|
|||||||
single_season['title'] = single_season.get('original_title', None)
|
single_season['title'] = single_season.get('original_title', None)
|
||||||
single_season['identifier'] = season_id
|
single_season['identifier'] = season_id
|
||||||
single_season['parent_identifier'] = identifier
|
single_season['parent_identifier'] = identifier
|
||||||
|
log.info("Adding Season %s" % season_id)
|
||||||
s = self.addToDatabase(params = single_season, type = "season")
|
s = self.addToDatabase(params = single_season, type = "season")
|
||||||
|
|
||||||
episode_params = {'season_identifier': season_id}
|
episode_params = {'season_identifier': season_id}
|
||||||
@@ -171,6 +172,10 @@ class ShowBase(MediaBase):
|
|||||||
single_episode['title'] = single_episode.get('original_title', None)
|
single_episode['title'] = single_episode.get('original_title', None)
|
||||||
single_episode['identifier'] = episode_id
|
single_episode['identifier'] = episode_id
|
||||||
single_episode['parent_identifier'] = single_season['identifier']
|
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")
|
e = self.addToDatabase(params = single_episode, type = "episode")
|
||||||
|
|
||||||
return parent
|
return parent
|
||||||
|
|||||||
@@ -157,8 +157,7 @@ class EpisodeLibraryPlugin(LibraryBase):
|
|||||||
except:
|
except:
|
||||||
log.debug('Failed to attach to library: %s', traceback.format_exc())
|
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()
|
db.expire_all()
|
||||||
return library_dict
|
return library_dict
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ class SeasonLibraryPlugin(LibraryBase):
|
|||||||
handle('library.update.season', identifier = l.identifier, default_title = toUnicode(attrs.get('title', '')))
|
handle('library.update.season', identifier = l.identifier, default_title = toUnicode(attrs.get('title', '')))
|
||||||
|
|
||||||
library_dict = l.to_dict(self.default_dict)
|
library_dict = l.to_dict(self.default_dict)
|
||||||
|
|
||||||
db.expire_all()
|
db.expire_all()
|
||||||
return library_dict
|
return library_dict
|
||||||
|
|
||||||
@@ -148,13 +147,11 @@ class SeasonLibraryPlugin(LibraryBase):
|
|||||||
file_obj = db.query(File).filter_by(id = file_obj.get('id')).one()
|
file_obj = db.query(File).filter_by(id = file_obj.get('id')).one()
|
||||||
library.files.append(file_obj)
|
library.files.append(file_obj)
|
||||||
db.commit()
|
db.commit()
|
||||||
|
|
||||||
break
|
break
|
||||||
except:
|
except:
|
||||||
log.debug('Failed to attach to library: %s', traceback.format_exc())
|
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()
|
db.expire_all()
|
||||||
return library_dict
|
return library_dict
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ class ShowLibraryPlugin(LibraryBase):
|
|||||||
handle('library.update.show', identifier = l.identifier, default_title = toUnicode(attrs.get('title', '')))
|
handle('library.update.show', identifier = l.identifier, default_title = toUnicode(attrs.get('title', '')))
|
||||||
|
|
||||||
library_dict = l.to_dict(self.default_dict)
|
library_dict = l.to_dict(self.default_dict)
|
||||||
|
|
||||||
db.expire_all()
|
db.expire_all()
|
||||||
return library_dict
|
return library_dict
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user