Commit graph

292 commits

Author SHA1 Message Date
JonnyWong16
b98b6050fe
Add properties to return the Plex Media Server data metadata paths (#1207)
* Add property to return the Plex Media Server data metadata path

* Add property to return the filepath for a resource

* Add tests for metadataDirectory and resourceFilepath
2023-08-27 12:59:53 -07:00
JonnyWong16
8298a61b64
Add search kwargs to LibrarySection.get() (#1191)
* Optimize methods to use library get/search

* Revert methods

* Fix reloading of episodes for missing parentRatingKey

* Add tests for LibrarySection.get with kwargs
2023-07-27 18:02:23 -07:00
JonnyWong16
58e279b837
Create separate PlexHistory objects (#1185)
* Create new PlexHistory object

* Add test for PlexHistory object
2023-07-27 17:45:51 -07:00
JonnyWong16
9ede493f4c
Add LibrarySection methods to multi-edit items (#1184)
* Use generator for string join

* Group media type edit mixins

* Add UserRatingMixin

* Add LibrarySection methods to multi-edit items

* Remove deprecated banners

* Factor out resource lock/unlock mixins

* Update `fetchItems` to accept list of rating keys

* Add repr and helper methods to Common object

* Update tests
2023-07-27 14:45:23 -07:00
JonnyWong16
37b37f1af0
Fix code block doc string formatting (#1144) 2023-05-24 13:55:22 -07:00
JonnyWong16
b4c463aff8
Add support for Continue Watching hubs (#1131)
* Add methods to retrieve continue watching items

* Add methods to remove movies/episodes from continue watching

* Add tests for continue watching
2023-05-24 12:03:28 -07:00
JonnyWong16
b5b70d81e2
Fix missing marker attribute for Movie (#1123) 2023-03-09 18:27:13 -08:00
JonnyWong16
0962cace85
Add advanced settings for show/season preferred audio/subtitle settings (#1114)
* Add advanced settings for Show/Season audio/subtitle settings

* Add tests for Show/Season audio/subtitle setting attributes
2023-03-09 15:34:49 -08:00
JonnyWong16
3c64bdb11c
Add support for editing addedAt field (#1107)
* Add AddedAtMixin

* Add tests for AddedAtMixin
2023-03-09 15:22:56 -08:00
JonnyWong16
a22830dc94
Add convenience method to set default audio and subtitle streams (#1085)
* Reload when accessing audioStreams or subtitleStreams

* Add setDefault method to AudioStream and SubtitleStream

* Update subtitle test

* Add `videoStreams()` convenience method

* Add test for `videoStreams()` method
2023-03-09 14:21:20 -08:00
JonnyWong16
1e220eb311
Add support for credit markers (#1094)
* Add credit markers

* Disable credit detection in bootstrap test server

* Add `first` property for credits markers

* Add credits detection setting attribute

* Update tests for credits detection setting
2023-03-09 13:32:17 -08:00
JonnyWong16
6350e85ff9
Add seasonCount attribute to Show (#1108)
* Add `seasonCount` attribute to `Show`

* Add test for show seasonCount

* Fix season year test

* Fix show studio test

* Fix season year test

Season year metadata is flakey
2023-03-09 13:18:59 -08:00
JonnyWong16
955c697549
Add Rating media tag (#1059)
* Add tagKey for Role

* Simplify Guid tag

* Sort tag attributes and update doc strings

* Add media Rating tag

* Add tests for Rating tag
2022-12-21 11:43:52 -08:00
JonnyWong16
9b0c8e5fd3
More f-string changes (#1025) 2022-11-08 13:40:18 -08:00
Rick Getz
52b3abfe69
Add container size to seasons request to allow more than 20 to be pulled (#1019)
* Add container size to seasons request to allow more than 20 to be pulled

* Add child count as container_size argument as requested.

* Spacing typo
2022-11-08 13:39:53 -08:00
JonnyWong16
020a32f2b8
Update PlexAPI to f-strings (#1000)
* Update plexapi to f-strings

* Update tests to f-strings
2022-08-27 22:56:01 -07:00
JonnyWong16
4d9e1d4f14
Add edition support for movies (#1010)
* Add editionTitle to Movie attributes

* Add EditionTitleMixin to Movie

* Add tests for movie editionTitle

* Add `editions()` method to Movie

* Add test for movie editions method
2022-08-27 06:17:33 -07:00
JonnyWong16
c8854c64c9
Add return self to various methods to support chaining (#986)
* Add return self to various methods to support chaining

* Fix runButlerTask test
2022-08-26 14:44:50 -07:00
JonnyWong16
f0ed19c2fe
Add PlayedUnplayedMixin (#984)
* Add PlayedUnplayedMixin

* Deprecate Video isPlayed, markWatched, and markUnwatched

* Rename all deprecated methods

* Return self to enable method chaining

* Update tests for audio markPlayed / markUnplayed using history

* Remove duplicate video history tests
2022-08-26 12:14:24 -07:00
JonnyWong16
f62dcbc5a4
Fix Video.optimize() method (#965)
* Add PlexObjects for all library media tags

* Add method to return all library media tags

* Add test for Library.tags

* Update Video.optimize

* Update video optimize test

* Use TAGTYPE for LibraryMediaTags

* Accept LibraryMediaTag as a search filter

* Use ratingKey and id before key in repr
2022-07-20 20:07:39 -07:00
JonnyWong16
925f573ced
Create separate PlexSession objects (#931)
* Add base findItem method

* Create new PlexSession objects

* PlexSession objects are unique from their base media objects. These objects are built from `/status/sessions` instead of `/library/metadata/<ratingKey>`. This allows reloading data from sessions without overwriting them.

* Add some media and client attributes for sessions

* Add separater property to return the PlexSession user object

* This speeds up building the `PlexSession` object since it doesn't need to lookup the user.
* The user object is also cached for future lookups.

* Remove PlexSession attributes from tests

* Never auto reload a PlexSession object

* Rename PlexSession.usernames for backwards compatibility

Co-authored-by: jjlawren <jjlawren@users.noreply.github.com>

* Don't cache myPlexAccount in PlexSession

* Move session stop method to PlexSession

Co-authored-by: jjlawren <jjlawren@users.noreply.github.com>
2022-07-20 20:03:20 -07:00
JonnyWong16
3107e25a0e
Fix searching and browsing Discover results (#970)
* Fix discover search results

* Plex API response changed to separate "Free on Demand" and "More Ways To Watch"

* Add test for searchDiscover

* Manually set watchlist and discover result to online metadata objects

* Replace all key format ratingKey with key

* Add libtype argument to searchDiscover

* Update tests for searchDiscover libtype

* Add includeUserState=1 parameter to Discover results details key

* Add method to return UserState object
2022-07-20 19:37:48 -07:00
JonnyWong16
f16058fa03
Minor improvements to fetching season/show (#950)
* Check parentIndex is an integer for Episode.seasonEpisode

* Saves an extra API call to `season()` for Season 0 (Specials)

* Use parentKey and grandparentKey to fetch show
2022-05-30 09:01:55 -07:00
JonnyWong16
fba0dbccf2
Add support for watchlists and streaming services (#922)
* Remove Plex news

* Replace requests with query method for online hubs

* Add myPlexAccount watchlist methods

* Add mixin for objects that can be added to watchlist

* Add tests for watchlist

* Always split ratingKey from guid for watchlist

* Add method to retrieve streaming service availability

* Add test for streaming service availability

* Add filtering and sorting for watchlists

* Fix watchlist tests

* Add method to check if an item is on a user's watchlist

* Update watchlist tests

* Make account optional for WatchlistMixin

* Add Discover search

* Use manuallyLoadXML method for Discover search results

* Remove webshows and podcasts

* Fix WatchlistMixin account AttributeError

* Add BadRequest exception when adding to/removing from watchlist

* Update watchlist tests for BadRequest

* Update watchlist doc strings
2022-05-18 11:04:18 -07:00
JonnyWong16
87a7ec6ddf
Add Video.audioStreams() convenience method (#891)
* Add Video.audioStreams() convenience method

* Add test for Video.audioStreams()
2022-02-26 22:24:43 -08:00
JonnyWong16
3e57c9b262
Add extras and hubs mixins (#890) 2022-02-26 22:04:18 -08:00
JonnyWong16
59638dc714
Add new methods to edit object fields (#876)
* Update Collection.edit() method

* Add new EditFieldMixin and subclasses

* Add EditFieldMixin to Plex objects

* Update PlexPartialObject.edit() doc string

* Cast Track parentIndex to int

* Add base _searchTypes property

* Add kwargs to editField

* Editing album title also requires the artist ratingKey

* Add tests for editing fields

* Deprecate Collection.edit()

* Make editing fields chainable

* Add chaining example to doc string

* Add batch editing mode

* Add test for batchEdits

* Clean up mixins imports

* Reorder mixins

* Fix tests for batch edit
2022-02-26 21:40:51 -08:00
ReenigneArcher
3917b335ca
Fix various typos (#880)
* Fix various typos

* Fix various typos in tests

* Fix typos in `tests`

* Fix more typos

* Fix hasScalingMatrix test

Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
2022-02-26 19:26:08 -08:00
ReenigneArcher
9a5170c2fb
Add Themes Support (#879)
* Fix typo in 'grandparentThumb'

* Add Themes support

* Fix Themes for Seasons and Episodes

Themes are not available for Seasons or Episodes according to this: https://web.archive.org/web/20150113085312/http://dev.plexapp.com/docs/agents/models.html

* Add Themes to Artists, Albums, and Tracks

Themes are available for Artists according to this: https://web.archive.org/web/20150113085312/http://dev.plexapp.com/docs/agents/models.html

* Update per PR review

* Update BaseResource and Theme classes

Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
2022-02-26 18:47:54 -08:00
meisnate12
2f101e3899
Add LabelMixin to Season, Episode, Artist, and Track objects (#872)
* Add LabelMixin to Episode class

* Add test_mixins.edit_label(episode) test

* Add Label Mixin to Season, Artist,and Track

* fix tests

* Load manual FilteringFields for labels

* Load manual FilteringFilters for labels

Co-authored-by: Elan Ruusamäe <glen@pld-linux.org>
Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
2022-02-26 17:32:18 -08:00
JonnyWong16
01131c95cf
Cleanup download methods (#847)
* Add utils.cleanFilename

* Refactor download methods

* Add option to download episodes, tracks, photos into subfolders

* Update download tests

* Test download keep_original_filename
2021-11-20 14:16:58 -08:00
JonnyWong16
2c540f69c8
Add producers, roles, and hasCommercialMarker to Episode objects (#797)
* Add producers and roles to Episode

* Add producers and roles to episode test

* Add hasCommercialMarker to Episode
2021-07-26 20:36:54 -05:00
JonnyWong16
67b3fc694a
Allow clips and extras to be streamed and downloaded 2021-06-06 17:50:35 -07:00
JonnyWong16
1d031166fc
Cleanup movie reviews and extras 2021-06-06 17:23:34 -07:00
JonnyWong16
6f44933f5b
Clean up Extra object 2021-06-06 16:40:25 -07:00
JonnyWong16
8f2ad955ab
Merge branch 'master' into reviews_extras 2021-06-06 15:02:03 -07:00
JonnyWong16
6448837112
Fix return typo in doc strings 2021-06-06 14:54:15 -07:00
JonnyWong16
7e8c93dcc7
Merge remote-tracking branch 'upstream/master' into bugfix/cleanup_findItems 2021-06-06 14:50:39 -07:00
JonnyWong16
fab55e1227
Merge branch 'master' into reviews_extras 2021-06-06 14:42:16 -07:00
blacktwin
4a4a945653 Move section method from Clip to Extra 2021-05-31 09:50:21 -04:00
JonnyWong16
6e58f7f70e Refactor lastRatedAt userRating attributes 2021-05-30 15:49:45 -07:00
JonnyWong16
06ff7410a6 Add rating mixin 2021-05-30 15:49:45 -07:00
blacktwin
44b4066273 Clip.section docstring update 2021-05-28 11:59:07 -04:00
blacktwin
49732cf92a Extra.addedAt docstring update. 2021-05-28 11:57:57 -04:00
blacktwin
0c8e5f9b5b Extra atrributes update cast int 2021-05-28 11:46:31 -04:00
JonnyWong16
3fc69a3709
Refactor usage of findItems 2021-05-24 17:28:11 -07:00
blacktwin
c0b6efc23c
Merge branch 'master' into reviews_extras 2021-05-24 07:21:34 -04:00
JonnyWong16
c76b2d4027
Merge remote-tracking branch 'upstream/master' into feature/multi_sort 2021-05-23 20:39:08 -07:00
JonnyWong16
a9597a9008
Merge remote-tracking branch 'upstream/master' into feature/plex_tv 2021-05-23 19:12:38 -07:00
JonnyWong16
d6cd71c971
Add lastRatedAt to Audio and Video 2021-05-15 22:38:35 -07:00