mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 02:06:09 +00:00
Patch to support pre 3.6 libraries
This commit is contained in:
parent
285b242a7f
commit
0dd54b019d
1 changed files with 17 additions and 8 deletions
|
@ -158,6 +158,20 @@ class Views(object):
|
||||||
self.delete_playlist_by_id(view_id)
|
self.delete_playlist_by_id(view_id)
|
||||||
self.delete_node_by_id(view_id)
|
self.delete_node_by_id(view_id)
|
||||||
|
|
||||||
|
def get_libraries(self):
|
||||||
|
|
||||||
|
try:
|
||||||
|
libraries = self.server['api'].get_media_folders()['Items']
|
||||||
|
views = self.server['api'].get_views()['Items']
|
||||||
|
except Exception as error:
|
||||||
|
LOG.error("Unable to process libraries: %s", error)
|
||||||
|
|
||||||
|
return []
|
||||||
|
|
||||||
|
libraries.extend([x for x in views if x['Id'] not in [y['Id'] for y in libraries]])
|
||||||
|
|
||||||
|
return libraries
|
||||||
|
|
||||||
def get_views(self):
|
def get_views(self):
|
||||||
|
|
||||||
''' Get the media folders. Add or remove them.
|
''' Get the media folders. Add or remove them.
|
||||||
|
@ -167,13 +181,7 @@ class Views(object):
|
||||||
'tvshows': "Series",
|
'tvshows': "Series",
|
||||||
'musicvideos': "MusicVideo"
|
'musicvideos': "MusicVideo"
|
||||||
}
|
}
|
||||||
try:
|
libraries = self.get_libraries()
|
||||||
libraries = self.server['api'].get_media_folders()['Items']
|
|
||||||
except Exception as error:
|
|
||||||
LOG.error("Unable to process libraries: %s", error)
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
self.sync['SortedViews'] = [x['Id'] for x in libraries]
|
self.sync['SortedViews'] = [x['Id'] for x in libraries]
|
||||||
|
|
||||||
for library in libraries:
|
for library in libraries:
|
||||||
|
@ -827,7 +835,8 @@ class Views(object):
|
||||||
if self.server['connected']:
|
if self.server['connected']:
|
||||||
|
|
||||||
if self.media_folders is None:
|
if self.media_folders is None:
|
||||||
self.media_folders = self.server['api'].get_media_folders()['Items']
|
|
||||||
|
self.media_folders = self.get_libraries()
|
||||||
|
|
||||||
for library in self.media_folders:
|
for library in self.media_folders:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue