Commit graph

215 commits

Author SHA1 Message Date
JonnyWong16
0913a916b7
Update MyPlexResource to use Plex API v2 (#1133)
* Update `MyPlexResource` to use Plex API v2

* Update doc strings
2023-07-27 14:01:18 -07:00
JonnyWong16
013d1a2d00
Update MyPlexAccount to use Plex API v2 (#1129)
* Update MyPlexAccount to use Plex API v2

* Update MyPlexAccount test

* Add rememberMe option to MyPlexAccount sign in

* Update MyPlexAccount do string
2023-07-27 14:00:46 -07:00
JonnyWong16
003f02c028
Pass session from MyPlexAccount to server/device connection (#1163) 2023-05-24 17:44:28 -07:00
JonnyWong16
cde1e04495
Refactor fetchItems for pagination (#1143)
* Refactor base fetchItems for pagination

* Use base fetchItems for LibrarySection methods

* Use base fetchItems for MyPlexAccount watchlist

* Use base fetchItems for PlexServer history

* Fix imports
2023-05-24 14:50:30 -07:00
JonnyWong16
1082866e70
Fix mutable default args for resource connection (#1160) 2023-05-24 13:55:50 -07:00
jjlawren
581a167180
Detect invalid token with myplex (#1138) 2023-05-24 12:04:32 -07:00
Elan Ruusamäe
981f1624ac
Add support Discover isPlayed/markPlayed/markUnplayed (#1090)
* Add isPlayed, markPlayed, markUnplayed to MyPlexAccount

* Add documentation for item

* Clarify that the methods change on Discover
2023-05-24 11:37:13 -07:00
JonnyWong16
a314caf861
Add pin parameter to switchHomeUser (#1076) 2022-12-21 13:57:23 -08:00
Elan Ruusamäe
e1e9a6995e
Fix: Remove bogus space from limit parameter (#1073) 2022-12-21 13:10:48 -08:00
Elan Ruusamäe
668fdbbe56
Allow overriding includeUserState for _toOnlineMetadata (#1071)
* Allow overriding includeUserState for _toOnlineMetadata

* Pass kwargs from watchlist to _toOnlineMetadata

Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
2022-12-21 13:10:09 -08:00
Elan Ruusamäe
c3d2a56a80
Use totalSize attribute for watchlist walking (#1070) 2022-12-21 13:02:02 -08:00
Elan Ruusamäe
b056e9d60b
Fix: Inherit session when creating internal PlexServer objects (#1069)
* Make myPlexAccount inherit session

* Pass session to _toOnlineMetadata PlexServer
2022-12-21 13:01:37 -08:00
JonnyWong16
ac41fbf4fb
Add 2FA code parameter for MyPlexAccount (#1063) 2022-12-21 11:44:34 -08:00
JonnyWong16
3216acfb41
Add methods to change Plex Home PIN (#1044)
* Add methods to change Plex Home PIN

* Add tests for changing Plex Home PIN
2022-11-08 15:57:54 -08:00
Sebastian Noel Lübke
f97b1c48c8
fix typo (#1041) 2022-11-08 15:57:30 -08:00
JonnyWong16
01c8ff269d
Fix initializing metadata.provider.plex.tv multiple times (#1027) 2022-11-08 15:57:16 -08:00
JonnyWong16
9b0c8e5fd3
More f-string changes (#1025) 2022-11-08 13:40:18 -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
Joshua Peek
fbc124aa57
Fix searchDiscover handling invalid results (#1013)
* Filter out bad discover search results

An stub object is sometimes returned from the API that is marked as
`'external'` but has has no `'SearchResults'` key.

    {'id': 'external', 'title': 'More Ways To Watch', 'size': 0}

* Wrap line to fit 127c

* Ensure empty array for SearchResult
2022-08-27 06:24:10 -07:00
JonnyWong16
02e3ddf3c1
Add maxresults parameter to MyPlexAccount.watchlist() (#1009)
* Add `maxresults` parameter to watchlist

* Test watchlist maxresults
2022-08-27 00:20:11 -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
716d8edb52
Add ability to toggle account view state syncing (#983)
* Add method to enable/disable view state syncing

* Add tests for view state sync
2022-08-26 12:00:46 -07:00
JonnyWong16
bb860ef3d4
Remove timeout argument from preferred_connections (#1005) 2022-08-05 20:16:29 -07:00
JonnyWong16
22dcd5dc5d
Remove unused timeout parameter from preferred_connections doc string (#987) 2022-08-05 19:52:34 -07:00
JonnyWong16
13282f157b
Use fetchItem for MyPlexAccount.userState() (#982) 2022-07-20 20:12:30 -07:00
JonnyWong16
9f7f11ba9c
Add support for Plex OAuth (#974)
* Add method to return Plex OAuth url

* Add helper utils function for Plex OAuth
2022-07-20 19:48:52 -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
76240dc7a8
Add method to switch Plex Home users (#958)
* Add method to switch Plex Home users

* Update user parameter types in doc strings
2022-07-20 19:05:29 -07:00
Elan Ruusamäe
650fbac312
Remove extending from (object), not needed in Python 3 (#943) 2022-05-30 09:05:00 -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
Kian-Meng Ang
398c058f18
Fix typos (#939) 2022-05-16 15:39:42 -05:00
jjlawren
d03a27450d
Allow exclusion keys in sharing settings (#908) 2022-03-17 16:54:27 -05: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
JonnyWong16
777ea754be
Add methods for accepting and cancelling friend invites (#849)
* Add accepting and cancelling friend invites

* Add mocked tests for acceptInvite and cancelInvite

* Rename methods to pendingInvite
2021-11-20 16:16:01 -08:00
jjlawren
3b1dce7a8d
Decouple resource address sorting from connection attempts (#800)
* Decouple resource address sorting from connection attempts

* Fix lint

* Move defaults to class
2021-07-26 20:38:16 -05:00
JonnyWong16
753a67ffcd
Remove Content-type header from sync 2021-07-16 10:14:25 -07:00
blacktwin
54ce61b006 use rtag for roles and entitlements 2021-06-14 00:58:13 -04:00
JonnyWong16
4d60101ab7
Remove Account settings
* Settings are only for Plex Web specific settings like remembering selected tab, poster size, etc.
2021-06-06 17:23:48 -07:00
JonnyWong16
f8c7fefd2f
Cleanup Account onlineMediaSources OptOut methods 2021-06-06 17:23:44 -07:00
JonnyWong16
8f2ad955ab
Merge branch 'master' into reviews_extras 2021-06-06 15:02:03 -07:00
blacktwin
5013028344 SETTINGS url change and OPTOUT url creation 2021-05-31 09:46:46 -04:00
blacktwin
ca97c60dcb replace eval with json.loads 2021-05-31 09:20:19 -04:00
blacktwin
70ad8ba10c updateOptOut docstring 2021-05-28 11:59:02 -04:00
blacktwin
226b9834f7 MyPlex.settings slight clean up and property 2021-05-28 11:57:52 -04:00
blacktwin
277f2ea717 onlineMediaSources further clean up 2021-05-28 11:57:46 -04:00
blacktwin
76719d9c70 onlineMediaSources clean up 2021-05-28 11:57:40 -04:00
blacktwin
aa0596d2a1 SETTINGS url string substitution update %s instead of .format() 2021-05-28 11:56:22 -04:00
JonnyWong16
0095e83f75
Cleanup utils imports 2021-05-26 19:45:12 -07:00
JonnyWong16
f81456d3b6 Refactor usage of listAttrs 2021-05-24 17:37:46 -07:00
JonnyWong16
3fc69a3709
Refactor usage of findItems 2021-05-24 17:28:11 -07:00