Commit graph

1629 commits

Author SHA1 Message Date
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
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
Dr.Blank
ba384e0be5
Refactor cast function in utils.py (#1340)
- less indentation, more readable code
- early return
2024-02-04 11:22:37 -08:00
JonnyWong16
d9539a357d
Add SplitMergeMixin to Album (#1339) 2024-02-04 10:53:08 -08:00
JonnyWong16
dfc54718d1
Fix MyPlexPinLogin doc strings (#1336) 2024-02-04 10:52:51 -08:00
JonnyWong16
654ed506f4
Also catch ValueError when converting timestamp to datetime (#1329) 2024-02-04 10:52:34 -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
b3ef1c22dd
Add warning for ambiguous library title (#1327) 2024-02-04 10:51:48 -08:00
Elan Ruusamäe
8bb9f5f213
Use 4k chunk size (powers of 2) for download (#1326) 2024-02-04 10:50:50 -08:00
JonnyWong16
4780026a73
Release 4.15.7 2023-12-22 16:45:20 -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
iDentitY4
189175150f
Fix subtitleLanguage attribute (#1308) 2023-12-22 12:49:44 -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
1c591f6438
Guard against None parentIndex (#1304)
https://github.com/pkkid/python-plexapi/pull/1251#discussion_r1394134558
2023-12-22 12:33:41 -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
JonnyWong16
c801268057
Release 4.15.6 2023-11-13 11:10:20 -08:00
JonnyWong16
3549902313
Fix flake8 #1295 (#1297) 2023-11-13 11:05:12 -08:00
Tom Niget
3653a156db
doc: fix documentation for BaseResource.provider (#1295) 2023-11-13 10:56:40 -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
ReenigneArcher
70b126f477
style(typehints): replace string typehints (#1289)
* style(typehints): replace string typehints

* style: revert variable type hint removal
2023-11-13 10:48:04 -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
JonnyWong16
2f888dfcfb
Check edit tags is a list (#1287)
Libraries have a `collections()` method which has the same name as media's `collections` attribute.
2023-11-13 10:41:13 -08:00
Dr.Blank
4924320715
Add support for 'group' and 'having' keys in smart filters (#1286)
* Add support for 'group' and 'having' keys in
SmartFilterMixin

- fixes #1285

* Add `group` and `having` fields to `additionalFields` list in `FilteringType` class

- This should allow passing the parsed filters back into `search()`.

Co-Authored-By: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>

---------

Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
2023-11-13 10:29:59 -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
JonnyWong16
6ce6dfde39
Release 4.15.5 2023-11-05 16:50:32 -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
JonnyWong16
7f5cf76cbd
Return None for history source if media no longer exists (#1269) 2023-11-02 21:24:29 -07:00
Jas Blackthorne
a9e2406e25
Update documentation for collection.sortUpdate. (#1277)
Co-authored-by: Morgan Blackthorne <morgan@windsofstorm.net>
2023-11-02 21:24:05 -07:00
ReenigneArcher
8798a9e739
fix: explicitly set includeFiles (#1281)
Co-authored-by: JonnyWong16 <9099342+jonnywong16@users.noreply.github.com>
2023-10-31 16:30:53 -07:00
Shanary
a257717614
Passing params for setSelectedSubtitles streams (#1265) 2023-10-11 22:25:17 -07:00
JonnyWong16
64eba5627e
Release 4.15.4 2023-10-03 21:22:31 -07:00
JonnyWong16
44fc13f2b5
Fix isLatest() and add canInstallUpdate() (#1263)
* Revert "Update isLatest() (#1253)"

This reverts commit b129fa3757.

* Add canInstallUpdate method

---------

Co-authored-by: Benjamin Oddou <85166574+BenjaminOddou@users.noreply.github.com>
2023-10-03 21:18:18 -07:00
Marc Mueller
dcedde1947
Fix datetime returning UTC (#1262)
* Replace datetime.utcfromtimestamp

* Update plexapi/utils.py

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

* Default using `fromtimestamp` and fallback to using `timedelta` from 0

---------

Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
2023-10-03 20:30:32 -07:00
jjlawren
d5cad1fe1c Release 4.15.3 2023-09-28 22:43:05 -05:00
jjlawren
57f27eaa4e
Fix handling of live TV sessions (#1260)
* Handle parsing live TV without season information

* Add guards for parent keys
2023-09-28 22:39:40 -05:00
JonnyWong16
94734ae939
Release 4.15.2 2023-09-17 17:07:07 -07:00
JonnyWong16
b57a5286cf
Change Episode parent* attributes to properties (#1251)
* Change Episode parent* attributes to cached_property

* This is to avoid the problems with auto-reloading when Episode objects are built with seasons hidden.

* Change Episode.seasonNumber to cached_property
2023-09-17 17:04:37 -07:00
Benjamin Oddou
b129fa3757
Update isLatest() (#1253)
* Update isLatest()

Use the canInstall attribute to determine if the release is the latest build.

* use of utils.cast

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

---------

Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
2023-09-17 16:04:41 -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
twolaw
b63bf7fcaf
Shut toDatetime error when subscribedAt is empty (#1250) 2023-09-17 15:37:22 -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
JonnyWong16
cbaaa196da
Add X-Plex-Language header to config (#1241) 2023-09-17 14:51:54 -07:00
twolaw
9fd46872cd
change discover search url (#1239) 2023-09-17 14:06:45 -07:00
JonnyWong16
7da49eb711
Release 4.15.1 2023-08-30 15:43:01 -07:00
Elan Ruusamäe
301310fb32
Fix: Fallback timeout from constructor in query() (#1231)
* Fallback PlexServer _timeout to TIMEOUT

* Fallback PlexServer query timeout to self._timeout

* Refactor MyPlexAccount, PlexClient query() to use timeout from constructor
2023-08-30 09:41:12 -07:00
ReenigneArcher
a6b6ebfbff
style: lint all python files (#1228) 2023-08-28 20:29:39 -07:00
ReenigneArcher
103bc6f8ef
feat(alert): add option to use custom socket (#1219) 2023-08-28 08:57:34 -07:00
ReenigneArcher
ec4b779ca8
style: fix F812 rule (#1221) 2023-08-27 14:10:18 -07:00
JonnyWong16
0399bea51e
Simplify PlexPartialObject eq return (#1230) 2023-08-27 13:24:29 -07:00
JonnyWong16
80fd90b687
Validate empty items explicitly (#1216) 2023-08-27 13:18:03 -07:00
Marc Mueller
ea4885acf7
Fix ElementTree DeprecationWarning when testing truth value (3.12) (#1209)
* Fix ElementTree DeprecationWarning when testing truth value (3.12)

* Use is None check

* Update more locations
2023-08-27 13:09:27 -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
61c805ff6b
Release 4.15.0 2023-07-27 20:14:37 -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
01f7ee5a40
Add SubtitleStream attributes for on-demand subtitles (#1190) 2023-07-27 18:09:01 -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
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
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
0913a916b7
Update MyPlexResource to use Plex API v2 (#1133)
* Update `MyPlexResource` to use Plex API v2

* Update doc strings
2023-07-27 14:01:18 -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
d94b6efc41
Change server continue watching endpoint (#1169) 2023-07-27 13:52:08 -07:00
JonnyWong16
cd40184403
Release 4.14.0 2023-05-24 17:51:16 -07:00
JonnyWong16
003f02c028
Pass session from MyPlexAccount to server/device connection (#1163) 2023-05-24 17:44:28 -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
1082866e70
Fix mutable default args for resource connection (#1160) 2023-05-24 13:55:50 -07:00
JonnyWong16
644bb3a057
Allow using MyPlexUser object for switchUser (#1154) 2023-05-24 13:55:36 -07:00
JonnyWong16
37b37f1af0
Fix code block doc string formatting (#1144) 2023-05-24 13:55:22 -07:00
JonnyWong16
c49697b74b
Do not add blank string to secrets log filter (#1142) 2023-05-24 13:53:55 -07:00
jjlawren
581a167180
Detect invalid token with myplex (#1138) 2023-05-24 12:04:32 -07:00
micha91
4946b4bc8b
Add Chapters to Track (#1134)
Audiobooks in m4b containers support chapters as meta data. These are provided in the XML, but not included in the Track Object of the plexapi
2023-05-24 12:04:03 -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
meisnate12
abc3464de3
Raise Exceptions on bad Download Responses (#1109)
* expose showstatus to downloadDatabases and downloadLogs

* throw errors for bad download responses
2023-05-24 11:37:37 -07:00
Elan Ruusamäe
981f1624ac
Add support Discover isPlayed/markPlayed/markUnplayed (#1090)
* Add isPlayed, markPlayed, markUnplayed to MyPlexAccount

* Add documentation for item

* Clarify that the methods change on Discover
2023-05-24 11:37:13 -07:00
JonnyWong16
405d21b6bc
Release 4.13.4 2023-03-09 18:31:55 -08:00
JonnyWong16
b5b70d81e2
Fix missing marker attribute for Movie (#1123) 2023-03-09 18:27:13 -08:00
JonnyWong16
74c0b933b4
Release 4.13.3 2023-03-09 17:57:28 -08:00
JonnyWong16
e7571ce311
Fix updateProgress docs (#1122) 2023-03-09 17:56:40 -08: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
Elan Ruusamäe
a00f1e2766
Cleanup duplicate header.platform reading (#1080)
It was originally a typo fallback for header.platorm before 3917b335c.

See also f26db5de
2023-03-09 14:50:46 -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
63fe34c2f4
Speed up searchType and tagType lookups (#1097) 2023-03-09 14:21:45 -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
8b3235445f
Release 4.13.2 2022-12-21 14:00:56 -08:00
JonnyWong16
a314caf861
Add pin parameter to switchHomeUser (#1076) 2022-12-21 13:57:23 -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