Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update media type attributes #630

Merged
merged 28 commits into from
Dec 31, 2020

Conversation

JonnyWong16
Copy link
Collaborator

@JonnyWong16 JonnyWong16 commented Dec 24, 2020

Description

This PR is mostly for bringing forward the attribute changes I made to the media type object from my 3.6.0-tautulli fork. It also unifies the methods between all the media type objects.

Attribute changes:

  • Refactored/added new/updated doc strings for Audio, Artist, Album, and Track attributes.
  • Refactored/added new/updated doc strings for Video, Movie, Show, Season, Episode, and Clip attributes.
  • Added new/updated doc strings for Photoalbum, and Photo attributes.
  • Updated doc strings for Collection attributes.
  • Updated doc strings for Playlist attributes.

New objects:

  • Added media.Style tag object.

New methods:

  • Track.locations common property to get the media.Part locations of the track.
  • Clip.locations common property to get the media.Part locations of the clip.
  • Photo.locations common property to get the media.Part locations of the photo.
  • Photoalbum.clip(title) method to return a clip in a photo album matching the title.
  • Photoalbum.clips() method to return all clips in a photo album.
  • Photoalbum.get() alias to Photoalbum.photo().
  • Collection.item(title) method to return an item in a collection matching the title.
  • Collection.get() alias to Collection.item().
  • Playlist.item(title) method to return an item in a playlist matching the title.
  • Playlist.get() alias to Playlist.item().

Method changes:

  • Separate title and season parameter in Show.season().
  • New album name and track number parameters in Artist.track().
  • New track number parameter in Album.track().

Breaking changes:

  • Some index, parentIndex, grandparentIndex and ratingKey, parentRatingKey, grandparentRatingKey attributes were type str and have now all been casted to int for consistency.
  • The collections attribute is removed from Episode since you cannot add an episode to a collection.
  • All titleSort attributes now default to title instead of returning a blank string.
  • The title parameter in Show.season() used to accept an integer for the season number which is now changed to the season parameter. Kept check for isinstance(title, int) for backwards compatibility.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the docstring for new or existing methods
  • I have added tests when applicable

plexapi/library.py Outdated Show resolved Hide resolved
tests/test_video.py Outdated Show resolved Hide resolved
@Hellowlol
Copy link
Collaborator

@JonnyWong16 I’ll merge when I can rebase this. On mobile atm.

@Hellowlol
Copy link
Collaborator

It was some failing tests. Ill need to manually check these before i merge

@JonnyWong16
Copy link
Collaborator Author

Just try re-running it.

keep compat for season(int)
plexapi/video.py Outdated Show resolved Hide resolved
plexapi/video.py Outdated Show resolved Hide resolved
@Hellowlol Hellowlol merged commit e62d997 into pkkid:master Dec 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants