Commit graph

616 commits

Author SHA1 Message Date
JonnyWong16
3a4c246ff5
Update getStreamURL() for dash protocol (#1120)
* Update `getStreamURL()`

* Update `getStreamURL()` test
2023-03-09 15:48:51 -08:00
JonnyWong16
0962cace85
Add advanced settings for show/season preferred audio/subtitle settings (#1114)
* Add advanced settings for Show/Season audio/subtitle settings

* Add tests for Show/Season audio/subtitle setting attributes
2023-03-09 15:34:49 -08: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
a22830dc94
Add convenience method to set default audio and subtitle streams (#1085)
* Reload when accessing audioStreams or subtitleStreams

* Add setDefault method to AudioStream and SubtitleStream

* Update subtitle test

* Add `videoStreams()` convenience method

* Add test for `videoStreams()` method
2023-03-09 14:21:20 -08:00
JonnyWong16
1e220eb311
Add support for credit markers (#1094)
* Add credit markers

* Disable credit detection in bootstrap test server

* Add `first` property for credits markers

* Add credits detection setting attribute

* Update tests for credits detection setting
2023-03-09 13:32:17 -08:00
JonnyWong16
6350e85ff9
Add seasonCount attribute to Show (#1108)
* Add `seasonCount` attribute to `Show`

* Add test for show seasonCount

* Fix season year test

* Fix show studio test

* Fix season year test

Season year metadata is flakey
2023-03-09 13:18:59 -08:00
JonnyWong16
c6482481e5
Fix episode attributes test year (#1103) 2023-02-02 23:23:13 -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
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
955c697549
Add Rating media tag (#1059)
* Add tagKey for Role

* Simplify Guid tag

* Sort tag attributes and update doc strings

* Add media Rating tag

* Add tests for Rating tag
2022-12-21 11:43:52 -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
9dbb2e5169
Create music playlist from m3u file (#1055)
* Create music playlists from m3u files

* Add test for playlist m3u import

* Add createCollection examples
2022-12-21 11:32:43 -08:00
JonnyWong16
c3af2d88c6
Fix MyPlexAccount.removePin() test (#1052) 2022-11-08 16:29:15 -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
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
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
e640f57319
Add utils.toJson(obj) function to convert an object to a JSON string (#998)
* Add `utils.toJson(obj)` function to convert an object to a JSON string

* Add test for utils.toJson()
2022-08-27 00:13:41 -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
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
meisnate12
6b29307aa2
Add ManagedHub Object and methods (#785) 2022-08-26 10:43:47 -07:00
JonnyWong16
20a6b3c06f
Ensure watchlist is cleared before tests (#1016) 2022-08-26 10:31:27 -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
117af58897
Add guids attribute to Artist, Album, and Track (#968)
* Add guids attribute to Artist, Album, and Track

* PMS 1.27.0.5897 adds `<Guid>` tags with MusicBrainz ID to artists, albums, and tracks.

https://forums.plex.tv/t/plex-media-server-forum-preview-for-music-metadata/785088
https://forums.plex.tv/t/plex-media-server/30447/510

* Update audio guid tests
2022-07-20 19:35:46 -07:00
JonnyWong16
caca24f10f
Add MediaPartStream.languageTag attribute (#959)
* Add `MediaPartStream.languageTag` attribute

* Add `languageTag` to tests
2022-07-20 19:06:06 -07:00
JonnyWong16
ae78557931
Fix show studio test (#979) 2022-07-20 17:00:55 -07:00
JonnyWong16
f361b29973
Fix movie year test (#967) 2022-06-20 09:01:27 -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
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
6fc7d95266
Add support for Plex guid in LibrarySection.getGuid() (#926)
* Add support for Plex guid in `LibrarySection.getGuid()`

* Update getGuid test with Plex guid
2022-05-16 19:54:51 -07:00
JonnyWong16
2683655dcf
Get album track by track number without keyword argument (#918)
* Get album track by track number

* Update tests for `Album.track()`

* Also updates test for `Season.episode()`
2022-05-16 19:52:16 -07:00
JonnyWong16
153ef66df0
Add method to manually run butler tasks (#916)
* Add butler tasks

* Add tests for butler tasks
2022-05-16 19:51:39 -07:00
JonnyWong16
76caa1d95e
Fix episode writers test (#938) 2022-05-16 11:45:27 -07:00
JonnyWong16
26671ec0b1
Fix movie tagline test (#927) 2022-04-07 09:58:06 -07:00
JonnyWong16
d248f1418b
Fix test track ratingCount attribute (#898) 2022-03-17 14:57:25 -05:00
JonnyWong16
372e620d60
Add support for collection "filtering based on user" advanced setting (#894)
* Add collectionFilterBasedOnUser attribute

* Add filterUserUpdate method

* Check for smart collection for updateSort

* Update test collection filterUserUpdate
2022-02-26 22:50:04 -08:00
JonnyWong16
0cb8712896
Add missing Track.skipCount attribute (#893)
* Add track skipCount attribute

* Add track.skipCount to tests
2022-02-26 22:31:21 -08: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
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
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
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
158dd37e41
Fix language in library tests (#889)
* Fix language in library tests

* "Other Videos" library type uses `language="xn"`

* Log server version in bootstrap server
2022-02-19 17:16:37 -08:00
JonnyWong16
b89bd23652
Change MusicSection.stations() to return Playlist objects (#871)
* Fix library stations

* `LibrarySection.stations()` returns a list of `Playlist` station objects

* Add test for MusicSection stations
2022-01-23 20:40:04 -08:00
JonnyWong16
0620eb4bf0
Fix Agent object settings (#864)
* Fix mediaType argument for PlexServer.agents()

* Cleanup Agent and AgentMediaType attributes

* Add `DeprecationWarning` to `languageCode`

* Make Agent.settings() method public

* Add `DeprecationWarning` to `Agent._settings()`

* Fix parsing Setting.enumValues

* XML attribute for agent settings uses `values` instead of `enumValues`

* Add secure and option attributes to Setting

* Add test for server agents
2022-01-23 16:15:10 -08:00
JonnyWong16
d2c849fa5e
Improve getGuid method (#862)
* Improve getGuid method

* Update getGuid test
2022-01-23 16:13:30 -08:00
JonnyWong16
fcbea70549
Add methods to lock and unlock a field for all items in a library (#861)
* Add plex folder to .gitignore

* Add method to lock/unlock a field for all items in a library

* Add test to lock/unlock all posters in a library
2022-01-23 16:11:20 -08:00
blacktwin
07717186ee additional edit test with bad path 2022-01-05 22:54:03 -05:00
blacktwin
9302f0dea1 additional edit coverage 2022-01-05 22:53:41 -05:00
blacktwin
0f2029545c fix section call 2022-01-05 09:14:34 -05:00
blacktwin
050572d2ac remove isBrowseable(Path) check 2022-01-05 09:14:19 -05:00
blacktwin
c19fa9f2d0 removing testing with Path object 2022-01-05 09:04:00 -05:00
blacktwin
01ab5bddf0 add isBrowseable using path object 2022-01-04 22:51:34 -05:00
blacktwin
11ad27bf61 add edit kwargs test 2022-01-04 22:47:06 -05:00
blacktwin
26732f7c8d fix for movie_path 2022-01-03 17:11:34 -05:00
blacktwin
2f752d215e removeLocations with a Path object
addLocations with a Path object
2022-01-03 17:09:30 -05:00
blacktwin
d2c3fb1117 attempt to remove all locations 2022-01-03 17:02:12 -05:00
blacktwin
ebcadd2996 incorrect exception 2021-12-20 00:19:24 -05:00
blacktwin
5494c1e90d Change test to use Other Videos library type to prevent scanning
Tests:
 Create library with multiple paths with valid paths
 Create library with multiple paths with an invalid path
 Create library with no path
 Add path(s) to test library with an invalid path
 Remove path(s) to test library with an invalid path
 Remove path(s) to test library with valid paths
 Add path(s) to test library with valid paths
2021-12-20 00:12:51 -05:00
JonnyWong16
a9ffd1e738
Fix image mixins tests (#856)
* Unlock images after edit image test

* Enable playlist art mixins tests

* Mark all image mixins tests as xfail

* Changing images can fail randomly
2021-11-20 17:14:34 -08:00
JonnyWong16
a8136d2776
Change LibrarySection.reload() to reload in-place (#855)
* Fix LibrarySection reload in-place to mimic PlexObject reload

* Don't reload LibrarySection after edit

* Also mimics PlexObject.edit()

* Update library section edit test
2021-11-20 16:35:37 -08:00
JonnyWong16
8815cda444
Add totalDuration and totalStorage properties to LibrarySection (#851)
* Add LibrarySection properties totalDuration and totalStorage

* Add tests for LibrarySection totalDuration and totalStorage
2021-11-20 16:29: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
JonnyWong16
4e8a6133eb
Fix media delete (#848)
* Fix media delete

* Update media delete test
2021-11-20 16:02:34 -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
34a42185ac
Update server transcodeImage method (#845)
* Update server transcodeImage method

* Update server transcodeImage tests
2021-11-20 13:53:00 -08:00
JonnyWong16
bf3f0c1392
Merge branch 'master' into feature/album_types 2021-10-04 14:13:39 -07:00
JonnyWong16
a3178f3ac3
Merge pull request #831 from JonnyWong16/feature/includeGuids
Automatically retrieve external guids from libraries using includeGuids
2021-10-04 13:56:11 -07: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
516c8ed02f
Update Plex Web URL tests 2021-09-26 15:23:35 -07:00
JonnyWong16
1efe0a908d
Update audio tests 2021-09-16 15:24:09 -07:00
JonnyWong16
046b2ec66d
Add test for getting and item using a guid 2021-09-15 15:47:21 -07:00
JonnyWong16
4d6cffdbd1
Add test for LibrarySection.all() returning guids 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
8a0b03c841
Merge branch 'master' into feature/web_url 2021-09-12 15:16:39 -07:00
JonnyWong16
3bebeaacd5
Add tests for Plex Web URLs 2021-08-25 18:10:11 -07:00
JonnyWong16
96a35dc379
Update Playlists test for posters 2021-08-25 18:10:02 -07:00
JonnyWong16
42260aa1b6
Add libtype argument for creating smart playlists (#799)
* Add libtype keyword argument for smart playlists

* Update docs, remove libtype collection from smart playlists/collections

* Cannot create a smart playlist or collection from other collections

* Update smart playlist filter test for libtype
2021-07-26 20:46:30 -05:00
JonnyWong16
6cacc4a55a
Add playlist title search and sorting (#782)
* Add title and sort arguments to server playlists method

* Raise NotFound when retrieving a playlist or collection

* Update tests for collection/playlist NotFound
2021-07-26 20:45:58 -05: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
456a8a53ab
Merge pull request #788 from JonnyWong16/feature/search_objects
Add ability to use FilterChoice and FilteringSort objects in library search
2021-07-16 09:21:55 -07:00
JonnyWong16
31de29d502
Merge pull request #783 from JonnyWong16/feature/custom_collection_order
Add ability to move items in a collection
2021-07-16 09:21:25 -07:00
JonnyWong16
82fa178952
Merge pull request #781 from JonnyWong16/feature/parse_smart_filter
Add ability to parse the smart filters from collections and playlists
2021-07-16 09:21:10 -07:00
JonnyWong16
b4314c1995
Add back custom sort to collection sort test authenticated only 2021-07-04 22:06:23 -07:00
JonnyWong16
b192e5eea9
Reset collection sort after move test to avoid corrupted XML 2021-07-04 21:45:34 -07:00
JonnyWong16
40c22711a6
Fix updateProgress and updateTimeline tests milliseconds 2021-07-04 21:32:58 -07:00
JonnyWong16
f7980e4a16
Update library search tests for FilterChoice and FilteringSort objects 2021-07-04 19:22:11 -07:00
JonnyWong16
ca0eb309c2
Update collection tests for moving items 2021-06-29 20:08:39 -07:00
JonnyWong16
663402ed74
Update tests 2021-06-18 15:26:24 -07:00
JonnyWong16
e51d8253f3
Add tests for smart collection/playlist filters 2021-06-18 14:34:53 -07:00
JonnyWong16
c111150666
Remove manual random sort test 2021-06-14 08:56:33 -07:00
JonnyWong16
b943bc61e5
Merge pull request #765 from JonnyWong16/feature/auto_reload
Allow overwriting attributes with None when manually reloading
2021-06-06 19:24:04 -07:00
JonnyWong16
c136c594ea
Mark online media sources tests with xfail
* Test account is missing online media sources?
2021-06-06 18:39:45 -07:00
JonnyWong16
8ef3d0ac35
Merge branch 'master' into feature/auto_reload 2021-06-06 18:05:08 -07:00