Commit graph

573 commits

Author SHA1 Message Date
JonnyWong16
4f4f60a584
Fix movie edition tests (#1196) 2023-07-27 17:44:09 -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
c8a555524e
Remove optional title argument from PhotoSection.searchAlbums() and PhotoSection.searchPhotos() (#1170)
* Remove optional `title` argument from `searchAlbums` and `searchPhotos`

* Update PhotoSection search tests
2023-07-27 14:35:02 -07:00
JonnyWong16
aa7a184b1f
Fix MyPlexAccount tests (#1195) 2023-07-27 14:30:09 -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
b4c463aff8
Add support for Continue Watching hubs (#1131)
* Add methods to retrieve continue watching items

* Add methods to remove movies/episodes from continue watching

* Add tests for continue watching
2023-05-24 12:03:28 -07:00
JonnyWong16
0080cc8964
Add blendColor parameter to transcodeImage() (#1121)
* Add `blendColor` to `transcodeImage()`

* Update `transcodeImage()` tests
2023-03-09 16:18:27 -08:00
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