Commit graph

254 commits

Author SHA1 Message Date
jjlawren
76ca35219a
Fix escape sequence in docstring regex (#1404) 2024-04-22 20:57:49 -07:00
Dr.Blank
25fa930c61
Fix: Bug introduced in #1373 list has not attr tag (#1396)
* regression test for https://github.com/Taxel/PlexTraktSync/discussions/1901

* bugfix https://github.com/Taxel/PlexTraktSync/discussions/1901
2024-04-19 12:42:16 -07:00
zhu0823
0108c95bd8
feat: Add params parameter to request (#1395)
* feat: Add params parameter to request

* Update plexapi/base.py

Co-authored-by: Dr.Blank <64108942+Dr-Blank@users.noreply.github.com>

---------

Co-authored-by: 朱校明 <zhuxiaoming@dstcar.com>
Co-authored-by: Dr.Blank <64108942+Dr-Blank@users.noreply.github.com>
2024-04-19 12:00:24 -07:00
Touchstone64
3e752d5f27
Fix: stop maxresults from overwriting previous results #1393 (#1394)
* Fix: stop maxresults from overwriting previous results

* Added test for use of maxresults in fetchItems #1393

* Removed the need for last_container_size #1393

* Renamed collections to better represen what is being tested

* Renamed collections to better represent what is being tested #1393

* Update tests/test_library.py with cleaner test

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

---------

Co-authored-by: Graham Thompson <graham.c.thompson@gmail.com>
Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
2024-04-19 10:57:54 -07:00
Dr.Blank
b836d24226
MediaContainer class is now a list (#1373)
* MediaContainer class is now a list

- can now support totalSize as returned from server

* add tests for media container

* Update MediaContainer attributes if previously None when extending
2024-03-31 15:48:24 -07:00
JonnyWong16
642ba8ba12
Allow exclude parameters in reload kwargs (#1378)
* Allow exclude parameters in reload

* Add test for reload kwargs
2024-03-16 15:18:14 -07:00
JonnyWong16
f779ed76e8
Fix escape characters in fetchItems doc string (#1370) 2024-03-16 15:03:55 -07:00
JonnyWong16
0601aaa40e
Add helper object to retrieve PlexObject (#1369) 2024-03-16 15:03:44 -07:00
Elan Ruusamäe
4b67b4db5c
Lowercase input of istartswith/iendswith (#1359)
To be symmetric with other case insensitive methods
that lowercase both operands in comparison
2024-02-17 14:35:53 -08:00
Elan Ruusamäe
7c99d4af05
Breaking: Change regex/iregex to use re.search instead of re.match (#1358)
* Change regex/iregex to use re.search instead of re.match

This is BREAKING CHANGE

* Also cast to bool.

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

---------

Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
2024-02-17 14:35:25 -08:00
Dr.Blank
41f6b9cf93
Refactor attribute filtering in PlexObject class (#1341)
* Refactor attribute filtering in PlexObject class

- minor performance imporvement

* Update plexapi/base.py

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

---------

Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
2024-02-17 14:16:21 -08:00
Elan Ruusamäe
019d3b8c68
Fix: Update guid filter examples for fetchItems (#1350)
* Update imdb guid filter with full agent name

it does not work otherwise like "^" anchor is used in the filter

* Add legacy imdb tt* for imdb to guid filter

* Add new agent Guid tag filtering example

* Add themoviedb prefix as well
2024-02-04 11:24:21 -08:00
JonnyWong16
e3d90a5945
Simplify building MediaPartStream objects (#1328)
* Simplify MediaPart._buildStreams

* Remove isChildOf check for photo and track attributes

* Add parent object when automatically building PlexObject

* Remove check of track only attribute in tests
2024-02-04 10:52:19 -08:00
JonnyWong16
f7522afd6b
Add lyricStreams() convenience method (#1303)
* Move videoStreams, audioStreams, lyricStreams to Playable

* Add lyricStreams to Playable

* Simplify returning list of streams

* Add test for track.lyricStreams()
2023-12-22 12:33:27 -08:00
ReenigneArcher
e0a425fdcb
feat: add PlexPartialObject.isLocked method (#1293)
Co-authored-by: JonnyWong16 <9099342+jonnywong16@users.noreply.github.com>
2023-11-13 10:56:30 -08:00
JonnyWong16
7f5cf76cbd
Return None for history source if media no longer exists (#1269) 2023-11-02 21:24:29 -07:00
Anagh Kumar Baranwal
7ff9e7b0d5
Remove reload after saving the batch-edits so the user can handle it themselves, if required. (#1247)
Signed-off-by: Anagh Kumar Baranwal <6824881+darthShadow@users.noreply.github.com>
2023-09-17 16:01:15 -07:00
Marc Mueller
dddc482614
Fix invalid escape sequence DeprecationWarning (#1244)
* Fix invalid escape sequence DeprecationWarning

* Remove escape chars
2023-09-17 14:52:14 -07:00
ReenigneArcher
a6b6ebfbff
style: lint all python files (#1228) 2023-08-28 20:29:39 -07:00
JonnyWong16
0399bea51e
Simplify PlexPartialObject eq return (#1230) 2023-08-27 13:24:29 -07:00
JonnyWong16
ba0c27c6ef
Remove support for Python 3.7 (#1198)
* Remove support for Python 3.7

* Update CI workflow

* Manually update dependencies
2023-07-27 20:05:40 -07:00
JonnyWong16
22e0e91c9d
Add config option to disable auto-reloading (#1187) 2023-07-27 18:24:04 -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
b06afb8f84
Check object is instance of PlexPartialObject for __eq__ comparison (#1182) 2023-07-27 14:40:14 -07:00
JonnyWong16
c4e03f41c2
Change updateProgress and updateTimeline to return self (#1132) 2023-05-24 14:50:45 -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
e7571ce311
Fix updateProgress docs (#1122) 2023-03-09 17:56:40 -08:00
JonnyWong16
3a4c246ff5
Update getStreamURL() for dash protocol (#1120)
* Update `getStreamURL()`

* Update `getStreamURL()` test
2023-03-09 15:48:51 -08:00
Elan Ruusamäe
7580fc84a9
Use cached_property decorator (#1065)
* Use @cached_property in PlexSession.user

* Use @cached_property in PlexServer.library

* Use @cached_property in PlexServer.settings

* Tests: Update clearing plex.settings cache

* Use @cached_property in LibrarySection.totalSize

* Add backports.cached-property==1.0.2; python_version<="3.7" dependency

* Import cached_property from dist or backports

* Add backports.cached-property to requirements_dev.txt

* Remove version pin for backports.cached-property in requirements.txt

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

Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
2022-12-21 11:51:45 -08:00
JonnyWong16
be42435ed3
Factor out playQueue() method to PlexPartialObject (#1058)
* Factor out `playQueue` to `PlexPartialObject`

* Update `PlayQueue.create()`

* Fix playqueue tests
2022-12-21 11:43:26 -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
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
Elan Ruusamäe
650fbac312
Remove extending from (object), not needed in Python 3 (#943) 2022-05-30 09:05:00 -07:00
JonnyWong16
f7f2b6b115
Make sure PlexObject private attributes are set before loading data (#946) 2022-05-30 08:53:27 -07:00
jjlawren
8e099dd15c
Avoid overwriting auto-reloaded attributes with None (#944) 2022-05-19 14:48:01 -05:00
JonnyWong16
8303d6fa2c
Allow disabling auto-reloading when accessing missing attributes (#935)
* Rename _autoReload to _overwriteNone

* Allow disabling auto reloading

* Update test for disabling auto reloading

* Change autoReload to private attribute
2022-05-16 20:03:06 -07:00
JonnyWong16
82aede202d
Use breadth-first search when using rtag (#912) 2022-05-16 19:46:10 -07: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
c08e032ee3
Add librarySectionID when using fetchItem (#885) 2022-02-26 20:17:23 -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
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
3fce24587d
Merge pull request #810 from JonnyWong16/feature/web_url
Add methods to retrieve the Plex Web URL
2021-10-04 12:38:24 -07:00
JonnyWong16
49ce2f9bb4
Refactor getWebURL 2021-09-26 15:23:35 -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
17ab4ce252
Add getWebURL for LibrarySection and library hubs 2021-08-25 18:10:11 -07:00