Temp fix series pooling for non admins

This commit is contained in:
angelblue05 2017-09-04 01:40:05 -05:00
parent e471f461e7
commit c1fa4f0ac2
2 changed files with 20 additions and 1 deletions

View file

@ -169,6 +169,16 @@ class Embydb_Functions():
return self.embycursor.fetchone() return self.embycursor.fetchone()
except: return False except: return False
def update_view_grouped_series(self, view_id, group_series):
query = ' '.join((
"UPDATE view",
"SET group_series = ?",
"WHERE view_id = ?"
))
self.embycursor.execute(query, (group_series, view_id))
def updateView(self, name, tagid, mediafolderid): def updateView(self, name, tagid, mediafolderid):
query = ' '.join(( query = ' '.join((

View file

@ -147,9 +147,16 @@ class Views(object):
self.add_playlist_node(media_type, view_id, view_name, view_type) self.add_playlist_node(media_type, view_id, view_name, view_type)
# Add view to emby database # Add view to emby database
group_series = self.emby.get_view_options(view_id)['EnableAutomaticSeriesGrouping'] if view_type == "tvshows" else None group_series = self.is_grouped_series(view_id, view_type)
self.emby_db.addView(view_id, view_name, view_type, tag_id, group_series) self.emby_db.addView(view_id, view_name, view_type, tag_id, group_series)
def is_grouped_series(self, view_id, view_type):
try:
return self.emby.get_view_options(view_id)['EnableAutomaticSeriesGrouping'] if view_type == "tvshows" else None
except Exception as error: # Currently admin only api entrypoint
log.error(error)
return None
def compare_view(self, media_type, view_id, view_name, view_type): def compare_view(self, media_type, view_id, view_name, view_type):
curr_view = self.emby_db.getView_byId(view_id) curr_view = self.emby_db.getView_byId(view_id)
@ -176,6 +183,8 @@ class Views(object):
# Update items with new tag # Update items with new tag
self._update_items_tag(curr_view_type[:-1], view_id, curr_tag_id, tag_id) self._update_items_tag(curr_view_type[:-1], view_id, curr_tag_id, tag_id)
group_series = self.is_grouped_series(view_id, view_type)
self.emby_db.update_view_grouped_series(view_id, group_series)
# Verify existance of playlist and nodes # Verify existance of playlist and nodes
self.add_playlist_node(media_type, view_id, view_name, view_type) self.add_playlist_node(media_type, view_id, view_name, view_type)
return True return True