diff --git a/plexapi/audio.py b/plexapi/audio.py index bb1dee22..f6701cc5 100644 --- a/plexapi/audio.py +++ b/plexapi/audio.py @@ -415,3 +415,12 @@ class Track(Audio, Playable, ArtUrlMixin, PosterUrlMixin, RatingMixin, def _defaultSyncTitle(self): """ Returns str, default title for a new syncItem. """ return '%s - %s - %s' % (self.grandparentTitle, self.parentTitle, self.title) + + def getWebURL(self, base=None): + """ Returns the Plex Web URL for the track's album. + + Parameters: + base (str): The base URL before the fragment (``#!``). + Default is https://app.plex.tv/desktop. + """ + return self._buildWebURL(base=base, key=self.parentKey) diff --git a/plexapi/photo.py b/plexapi/photo.py index f3196663..008a97e1 100644 --- a/plexapi/photo.py +++ b/plexapi/photo.py @@ -137,6 +137,15 @@ class Photoalbum(PlexPartialObject, ArtMixin, PosterMixin, RatingMixin): filepaths.append(filepath) return filepaths + def getWebURL(self, base=None): + """ Returns the Plex Web URL for the photoalbum. + + Parameters: + base (str): The base URL before the fragment (``#!``). + Default is https://app.plex.tv/desktop. + """ + return self._buildWebURL(base=base, legacy=True) + @utils.registerPlexObject class Photo(PlexPartialObject, Playable, ArtUrlMixin, PosterUrlMixin, RatingMixin, TagMixin): @@ -301,3 +310,12 @@ class Photo(PlexPartialObject, Playable, ArtUrlMixin, PosterUrlMixin, RatingMixi if filepath: filepaths.append(filepath) return filepaths + + def getWebURL(self, base=None): + """ Returns the Plex Web URL for the photo's photoalbum. + + Parameters: + base (str): The base URL before the fragment (``#!``). + Default is https://app.plex.tv/desktop. + """ + return self._buildWebURL(base=base, key=self.parentKey, legacy=True) diff --git a/plexapi/playlist.py b/plexapi/playlist.py index bac46965..3bb18913 100644 --- a/plexapi/playlist.py +++ b/plexapi/playlist.py @@ -459,3 +459,12 @@ class Playlist(PlexPartialObject, Playable, ArtMixin, PosterMixin, SmartFilterMi raise Unsupported('Unsupported playlist content') return myplex.sync(sync_item, client=client, clientId=clientId) + + def getWebURL(self, base=None): + """ Returns the Plex Web URL for the playlist. + + Parameters: + base (str): The base URL before the fragment (``#!``). + Default is https://app.plex.tv/desktop. + """ + return self._buildWebURL(base=base, endpoint='playlist')