Commit graph

59 commits

Author SHA1 Message Date
JonnyWong16
284a5773e3
Add genres attribute to Track (#1318)
* Add genres attribute to Track

* Test track genres

* Add GenreMixin to Tracks

* Add test for editing track genre
2024-02-17 14:11:07 -08:00
JonnyWong16
ca13bcaf45
Remove DeprecationWarning for watched methods (#1306)
* Remove deprecation warnings for watched

* Test alias watched methods
2023-12-22 12:48:56 -08:00
ReenigneArcher
70b126f477
style(typehints): replace string typehints (#1289)
* style(typehints): replace string typehints

* style: revert variable type hint removal
2023-11-13 10:48:04 -08:00
JonnyWong16
2f888dfcfb
Check edit tags is a list (#1287)
Libraries have a `collections()` method which has the same name as media's `collections` attribute.
2023-11-13 10:41:13 -08:00
Dr.Blank
4924320715
Add support for 'group' and 'having' keys in smart filters (#1286)
* Add support for 'group' and 'having' keys in
SmartFilterMixin

- fixes #1285

* Add `group` and `having` fields to `additionalFields` list in `FilteringType` class

- This should allow passing the parsed filters back into `search()`.

Co-Authored-By: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>

---------

Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
2023-11-13 10:29:59 -08:00
JonnyWong16
556b4b3da4
Use edit mixins for Playlists (#1284)
* Use mixins to edit playlists

* Add titleSort attribute to Playlists

* Update Playlists edit tests

* Fix deprecation warning stacklevel

* Fix edit title for m3u playlist
2023-11-13 10:29:03 -08:00
Dr.Blank
56a8df659d
Update algorithm for parsing smart filters (#1276)
* Fix minor typo

* Update algorithm for parsing  #1274

* Match style guide of the module

* Fix Edge Cases

- `and` is now considered the default operation instead of raising error
- fix algorithm so that the reserved keys are parsed in the filters dictionary instead of filters group when located later in the feed.
- removed some code repetition

* Join multiple filters by default

If multiple filter groups are parsed they are joined by `and` instead of raising error.

* fix `==` operator parsing

transfers "=" from the value to key

* fix typehinting

* Add new test for smart Filters

this test would fail on old algorithm despite it being logically the exact same filter.

* add test for deeply nested filters

* combine filters test for playlist

* combine filters test for collections

* fix typo

* add test to check parsed fitlers as it is

* edited test to be independent of the server

* Apply suggestions from code review

adhere to style guide of the project

Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>

---------

Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
2023-11-05 16:23:57 -08:00
ReenigneArcher
a6b6ebfbff
style: lint all python files (#1228) 2023-08-28 20:29:39 -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
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
3c64bdb11c
Add support for editing addedAt field (#1107)
* Add AddedAtMixin

* Add tests for AddedAtMixin
2023-03-09 15:22:56 -08:00
JonnyWong16
0e958f6136
Fix unable to remove tags with special characters (#1102)
* Ensure removed tags are URL encoded

* Add special characters to test mixin tag
2023-03-09 14:49:52 -08:00
JonnyWong16
9b8c7d522d
Properly close file object in mixin uploads (#1074)
* Properly close file object in mixin uploads

* Also support a file-like object as the upload `filepath` parameter

* Update image upload tests for file-like object
2022-12-21 13:56:02 -08:00
ReenigneArcher
b5110722fd
Add timeout parameter to uploadTheme (#1039)
Since themes may take a while to upload, it may be beneficial to have a separate `timeout` option for uploading themes, instead of using the default `config.TIMEOUT`.
2022-12-21 11:32:07 -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
ef12e64a6f
Add support for using MediaTag objects when editing tags (#994)
* Support using MediaTag objects when editing tags

* Update tests for editing tags with MediaTag objects
2022-08-26 22:52:50 -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
db03046d2c
Fix resource mixins to use ratingKey instead of key (#992) 2022-08-05 19:53:06 -07:00
JonnyWong16
71d11a4280
Fix Artists.matches() when searching by title (#981) 2022-07-20 20:10:25 -07:00
JonnyWong16
d09cc47562
Use /related endpoint for hubs (#978) 2022-07-20 19:49:11 -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
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
JonnyWong16
3e57c9b262
Add extras and hubs mixins (#890) 2022-02-26 22:04:18 -08:00
JonnyWong16
870ba6664f
Refactor and cleanup tag methods (#875)
* Refactor tag functions into EditTagsMixin

* Fix test mixins tag use of _tagSingular

* Add kwargs to editTags

* Fix _tagSingular and _tagPlural if tag is already singular or plural

* Make editing tags chainable

* Add chaining example to doc string

* Update editTags doc string for batch editing
2022-02-26 21:50:48 -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
JonnyWong16
a568819e1e
Add tests for theme mixin (#897)
* Add lockTheme and unlockTheme methods

* Change setTheme to raise NotImplementedError

* Add tests for theme mixins
2022-02-26 21:05:43 -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
JonnyWong16
842ec8ac42
Add includeGuids when parsing smart filters 2021-09-15 15:38:54 -07:00
JonnyWong16
692a23586c
Add methods to lock and unlock artwork and posters (#825)
* Add private _edit method

* Add fields attribute to playlists

* Add lock and unlock methods to art, banner, and poster mixins

* Add tests for locking and unlocking art and posters
2021-09-12 19:56:21 -05:00
JonnyWong16
0b81f0887b
Add SmartFilterMixin 2021-06-18 14:24:59 -07:00
JonnyWong16
7e8c93dcc7
Merge remote-tracking branch 'upstream/master' into bugfix/cleanup_findItems 2021-06-06 14:50:39 -07:00
JonnyWong16
e965ebbbe6
Merge remote-tracking branch 'upstream/master' into feature/rating_mixin 2021-06-06 12:54:09 -07:00
JonnyWong16
06ff7410a6 Add rating mixin 2021-05-30 15:49:45 -07:00
JonnyWong16
b2ecd2b7f9
Add AdvancedSettingsMixin to Collection 2021-05-29 18:48:31 -07:00
JonnyWong16
3fc69a3709
Refactor usage of findItems 2021-05-24 17:28:11 -07:00
meisnate12
b9bf8eeabc updated AdvancedSettingsMixin 2021-04-06 23:44:28 -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
aa3c37e5b5
Clean doc strings 2021-02-14 20:06:49 -08:00
JonnyWong16
32f00e653a
Add alias posterUrl to thumbUrl 2021-02-14 19:58:18 -08:00
JonnyWong16
9fa51cee2a
Subclass image url mixins 2021-02-14 19:38:09 -08:00
JonnyWong16
c41f89bf9b
Factor out artUrl, thumbUrl, bannerUrl to mixins 2021-02-14 19:12:18 -08:00
JonnyWong16
1cc60b4358
Add banner mixin for shows 2021-02-14 16:11:50 -08:00
JonnyWong16
84f787a2cc
Merge remote-tracking branch 'upstream/master' into feature/edit_tags 2021-02-14 14:38:21 -08:00
JonnyWong16
28b1f9e9a6
Add ability to lock/unlock fields when adding/removing tags 2021-02-11 09:28:15 -08:00
JonnyWong16
d87547e2f9
Rename writer mixin 2021-02-07 10:54:03 -08:00
JonnyWong16
02c56841f0
Merge remote-tracking branch 'upstream/master' into feature/posters 2021-02-07 10:46:20 -08:00
JonnyWong16
a7e5763e78
Merge remote-tracking branch 'upstream/master' into feature/posters 2021-02-07 09:33:15 -08:00