mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-24 09:46:11 +00:00
Temp fix series pooling for non admins
This commit is contained in:
parent
e471f461e7
commit
c1fa4f0ac2
2 changed files with 20 additions and 1 deletions
|
@ -169,6 +169,16 @@ class Embydb_Functions():
|
|||
return self.embycursor.fetchone()
|
||||
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):
|
||||
|
||||
query = ' '.join((
|
||||
|
|
|
@ -147,9 +147,16 @@ class Views(object):
|
|||
|
||||
self.add_playlist_node(media_type, view_id, view_name, view_type)
|
||||
# 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)
|
||||
|
||||
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):
|
||||
|
||||
curr_view = self.emby_db.getView_byId(view_id)
|
||||
|
@ -176,6 +183,8 @@ class Views(object):
|
|||
# Update items with new tag
|
||||
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
|
||||
self.add_playlist_node(media_type, view_id, view_name, view_type)
|
||||
return True
|
||||
|
|
Loading…
Reference in a new issue