Commit graph

275 commits

Author SHA1 Message Date
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
JonnyWong16
5e7a5e572c
Add hasPreviewThumbnails properties 2021-05-10 18:06:50 -07:00
JonnyWong16
b27e12c5d9
Add episodeNumber property 2021-05-10 17:56:06 -07:00
JonnyWong16
64f647e12b
Add addition season and episode attributes
* Season.parentStudio
* Season.year
* Episode.parentYear
2021-05-09 21:28:17 -07:00
JonnyWong16
158c5f5633
Merge pull request #730 from JonnyWong16/bugfix/episode_tests
Fix retrieving Season.episode() by episode number
2021-05-09 19:44:52 -07:00
JonnyWong16
ecd9309383
Merge pull request #729 from JonnyWong16/feature/smart_collections
Add new collection attributes
2021-05-09 19:44:27 -07:00
JonnyWong16
246ad82f86
Add CollectionMixin to Season, Episode, and Track 2021-05-09 12:24:55 -07:00
JonnyWong16
c6c9d83bca
Fix getting Season.episode by episode number 2021-04-24 11:49:36 -07:00
meisnate12
c957c4fc98 exclude leaves from show seasons 2021-04-14 11:43:21 -04:00
blacktwin
8aaa0c09a7 spelling & indent correction 2021-04-14 08:02:04 -04:00
blacktwin
0bacdbeabf
readding MediaContainer import 2021-04-12 13:16:33 -04:00
blacktwin
5d670364d6
fixing import
missed last import in copy/paste from master.
2021-04-12 13:12:46 -04:00
blacktwin
790d12504a
flake fix
remove trailing comma
2021-04-12 13:10:41 -04:00
blacktwin
f92878d75f
Merge branch 'master' into reviews_extras 2021-04-12 13:08:29 -04:00
meisnate12
5584ef1d4f
Added AdvancedSettingsMixin (#714)
* Added AdvancedSettingsMixin

* forgot import

* shortened line

* remove whitespace

* removed unused import

* reordered mixins

* Add preference method to AdvancedSettingsMixin

* Add tests for AdvancedSettingsMixin

Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
2021-04-05 15:44:49 -05:00
JonnyWong16
ef18e2c256
Fix parsing episode parentRatingKey from parentThumb (#699) 2021-03-22 14:35:07 -05:00
JonnyWong16
6e501728a0
Cast librarySectionID to int 2021-03-11 13:27:08 -08:00
JonnyWong16
c15133da88
Adds Movie and Artist advanced setting attributes (#680)
* Add advanced setting attributes to movie

* Add advanced setting attributes to artist

* Update tests for movie advanced setting attributes

* Update tests for artist advanced setting attributes

* Fix artist albumSort attribute
2021-03-11 11:20:28 -06:00