Commit graph

224 commits

Author SHA1 Message Date
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
JonnyWong16
0811e5334c
Add method to get the Plex Web URL for media items 2021-08-25 18:10:11 -07:00
JonnyWong16
624c3f8f47
Merge pull request #778 from pkkid/account_roles
Fix for accessing Account of non Plex Pass account
2021-06-15 21:14:40 -07:00
blacktwin
7678e0cfef add iter on a specific root tag in listAttrs 2021-06-14 00:57:07 -04:00
JonnyWong16
90a1cff01e
Fix return value when using USER_DONT_RELOAD_FOR_KEYS 2021-06-07 08:55:04 -07:00
JonnyWong16
8ef3d0ac35
Merge branch 'master' into feature/auto_reload 2021-06-06 18:05:08 -07:00
JonnyWong16
67b3fc694a
Allow clips and extras to be streamed and downloaded 2021-06-06 17:50:35 -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
JonnyWong16
a88cedbce8
Merge remote-tracking branch 'upstream/master' into feature/auto_reload 2021-06-06 14:35:58 -07:00
JonnyWong16
13215152c9
Explicit check for parent is not None
* Checking if parent is truthy calls the __len__ method which does not work for some Plex objects until after it is initialized with _loadData.
2021-06-06 13:51:59 -07:00
JonnyWong16
4d12cc9a49
Move reload to private method to hide the autoReload parameter 2021-06-02 08:59:52 -07:00
JonnyWong16
70bbfa3c84
Allow overwriting attributes with None when manually reloading 2021-05-30 16:25:25 -07:00
blacktwin
9982b8e108 MediaContainer docstring 2021-05-28 11:58:55 -04:00
blacktwin
9f5f2b7b12 MediaContainer attribute ordering 2021-05-28 11:58:50 -04:00
JonnyWong16
0095e83f75
Cleanup utils imports 2021-05-26 19:45:12 -07: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
6d4e7bed95 Add random sorting option 2021-05-15 11:25:42 -07:00
blacktwin
f92878d75f
Merge branch 'master' into reviews_extras 2021-04-12 13:08:29 -04:00
blacktwin
227bb51717
remove Release
Release class was unintendedly added by a merge before it was properly located.
2021-04-12 13:07:10 -04:00
Elan Ruusamäe
a3d43781fa
Add deviceID to Playable for history entries (#704)
* Add deviceID to Playable for history entries

* Add missing documentation for accountID/deviceID
2021-03-22 14:40:13 -05:00
JonnyWong16
061ad9fefd
More PlexAPI filtering docs to fetchItems 2021-03-12 09:18:36 -08:00
JonnyWong16
d752b351d5
Update fetchItem doc string 2021-03-11 23:23:03 -08:00
JonnyWong16
c77dc4a595
Cast librarySectionID to int 2021-03-11 12:20:56 -08:00
blacktwin
9d2ec9546e
Merge branch 'master' into reviews_extras 2021-03-09 08:26:52 -05:00
Shubhendra Singh Chauhan
12cf146ace
fix: code quality issues (#670)
* Remove unnecessary use of comprehension

* Remove unnecessary comprehension

* Use literal syntax instead of function calls to create data structure

* Pass string format arguments as logging method parameters

* Remove unused imports

* Remove unnecessary generator

* Refactor `if` expression

* fixed typo

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

* Update tests/test_audio.py

Co-authored-by: jjlawren <jjlawren@users.noreply.github.com>
2021-02-24 11:55:53 -06:00
JonnyWong16
61a68ebf8a
Merge remote-tracking branch 'upstream/master' into feature/mixins 2021-02-24 09:04:52 -08:00
JonnyWong16
6d42030492
Move Release to server module 2021-02-14 21:56:28 -08:00