Skip to content

Commit e10f96a

Browse files
committed
Add getPlaylistsWebURL for the server playlists page
1 parent 17ab4ce commit e10f96a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

plexapi/server.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,25 @@ def resources(self):
890890
key = '/statistics/resources?timespan=6'
891891
return self.fetchItems(key, StatisticsResources)
892892

893+
def getPlaylistsWebURL(self, base=None, tab=None):
894+
""" Returns the Plex Web URL for the server playlists page.
895+
896+
Parameters:
897+
base (str): The base URL before the fragment (``#!``).
898+
Default is https://app.plex.tv/desktop.
899+
tab (str): The playlist tab (audio, video, photo).
900+
"""
901+
if base is None:
902+
base = 'https://app.plex.tv/desktop/'
903+
904+
params = {'source': 'playlists'}
905+
if tab is not None:
906+
params['pivot'] = 'playlists.%s' % tab
907+
908+
return '%s#!/media/%s/com.plexapp.plugins.library%s' % (
909+
base, self._server.machineIdentifier, utils.joinArgs(params)
910+
)
911+
893912

894913
class Account(PlexObject):
895914
""" Contains the locally cached MyPlex account information. The properties provided don't

0 commit comments

Comments
 (0)