Commit graph

598 commits

Author SHA1 Message Date
Dr.Blank
fe648f6382
bugfix: pass existing filters for albums method of Artist (#1347)
* bugfix: pass existing filters for `albums` method of `Artist`

* add test for bugfix
2024-02-04 11:23:56 -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
d4426dab86
Add support for on-demand subtitles (#1305)
* Add support for on-demand subtitle search

* Clean up uploadSubtitles and removeSubtitles methods

* Add test for on-demand subtitles

Account is required for on-demand subtitles

* Add hearingImpaired and perfectMatch to SubtitleStream attributes

* Update subtitle score doc string

The score is the OpenSubtitles download count

Ref: https://forums.plex.tv/t/subtitle-search-update-opensubtitles/862746
2023-12-22 13:13:04 -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
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
0708821566
test: fix test_audio_Audio_sonicallySimilar authenticated test (#1298)
* test: fix test_audio_Audio_sonicallySimilar authenticated test

* Update tests/test_audio.py

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

---------

Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
2023-11-14 16:15:30 -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
Dr.Blank
9e8fcb5fa6
Add sonicallySimilar method to Audio class (#1288)
* Add sonicallySimilar method to Audio class

closes #1183

* Add type hinting for method

- fixes import error

* Apply review suggestions

Co-Authors @JonnyWong16

* Add optional parameters to sonicallySimilar method

- makes it so that params can be None and use the server default

* add test for `sonicallySimilar`

* Refactor test to check type of elements

* Apply suggestions

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

* Add authentication to sonicallySimilar test in
test_audio.py

* fix flake8

---------

Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
2023-11-13 10:47:48 -08:00
ReenigneArcher
799e5c690b
tests: improve audio tests (#1294) 2023-11-13 10:35:36 -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
JonnyWong16
253949c1fe
Add MyPlexAccount.ping() to refresh authentication token (#1271)
* Add `MyPlexAccount.ping()` to refresh auth token

* Test account ping
2023-11-02 21:24:46 -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
Elan Ruusamäe
e466af58ee
test_audio: Add missing assert (#1245) 2023-09-17 15:36:45 -07:00
ReenigneArcher
a6b6ebfbff
style: lint all python files (#1228) 2023-08-28 20:29:39 -07:00
ReenigneArcher
dba3369f55
docs: add Windows make file (#1222) 2023-08-28 09:41:11 -07:00
ReenigneArcher
b783a56edc
Tests skip additional tests that require plex pass (#1227)
* tests: skip additional tests that require Plex Pass

* tests(test_myplex_users): check if first user has access to any server

* tests(fixture): adjust plex pass required skip message
2023-08-27 14:24:54 -07:00
JonnyWong16
b98b6050fe
Add properties to return the Plex Media Server data metadata paths (#1207)
* Add property to return the Plex Media Server data metadata path

* Add property to return the filepath for a resource

* Add tests for metadataDirectory and resourceFilepath
2023-08-27 12:59:53 -07:00
JonnyWong16
0679816201
Rename "setDefault" to "setSelected" for media streams (#1206)
* Rename "setDefault" to "setSelected"

* Update tests for setSelected subtitle stream
2023-08-27 12:41:37 -07:00
JonnyWong16
f67f4f7c2c
Add methods to retrieve public IP and geolocation (#1205)
* Add methods to retrieve public IP and geolocate

* Add test for geoip
2023-08-27 12:34:52 -07:00
JonnyWong16
6471582c92
Add method to retrieve Plex server identity (#1204)
* Add server identity

* Add test for server identity
2023-08-27 12:06:40 -07:00
JonnyWong16
35008908fc
Improve parsing to datetime and add error handling (#1203)
* Improve parsing to datetime and add error handling

* Fix utils.millisecondToHumanstr for days and negatives

* Update tests for millisecondToHumanstr
2023-08-27 12:06:07 -07:00
JonnyWong16
c5108b1115
Add score and tagKey attribute to hub search results (#1186)
* Add `score` and `tagKey` attribute to hub search results

* Update tests for hub search result `score` and `tagKey` attributes
2023-07-27 18:08:46 -07:00
JonnyWong16
8298a61b64
Add search kwargs to LibrarySection.get() (#1191)
* Optimize methods to use library get/search

* Revert methods

* Fix reloading of episodes for missing parentRatingKey

* Add tests for LibrarySection.get with kwargs
2023-07-27 18:02:23 -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
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