@@ -890,24 +890,41 @@ 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 .
893+ def _buildWebURL (self , base = None , endpoint = None , ** kwargs ):
894+ """ Build the Plex Web URL for the object .
895895
896896 Parameters:
897897 base (str): The base URL before the fragment (``#!``).
898898 Default is https://app.plex.tv/desktop.
899- tab (str): The playlist tab (audio, video, photo).
899+ endpoint (str): The Plex Web URL endpoint.
900+ None for server, 'playlist' for playlists, 'details' for all other media types.
901+ **kwargs (dict): Dictionary of URL parameters.
900902 """
901903 if base is None :
902904 base = 'https://app.plex.tv/desktop/'
903905
904- params = {'source' : 'playlists' }
905- if tab is not None :
906- params ['pivot' ] = 'playlists.%s' % tab
906+ if endpoint :
907+ return '%s#!/server/%s/%s%s' % (
908+ base , self .machineIdentifier , endpoint , utils .joinArgs (kwargs )
909+ )
910+ else :
911+ return '%s#!/media/%s/com.plexapp.plugins.library%s' % (
912+ base , self .machineIdentifier , utils .joinArgs (kwargs )
913+ )
914+
915+ def getWebURL (self , base = None , playlistTab = None ):
916+ """ Returns the Plex Web URL for the server.
907917
908- return '%s#!/media/%s/com.plexapp.plugins.library%s' % (
909- base , self ._server .machineIdentifier , utils .joinArgs (params )
910- )
918+ Parameters:
919+ base (str): The base URL before the fragment (``#!``).
920+ Default is https://app.plex.tv/desktop.
921+ playlistTab (str): The playlist tab (audio, video, photo). Only used for the playlist URL.
922+ """
923+ if playlistTab is not None :
924+ params = {'source' : 'playlists' , 'pivot' : 'playlists.%s' % playlistTab }
925+ else :
926+ params = {'key' : '/hubs' , 'pageType' : 'hub' }
927+ return self ._buildWebURL (base = base , ** params )
911928
912929
913930class Account (PlexObject ):
0 commit comments