Commit graph

2347 commits

Author SHA1 Message Date
Joshua Peek
fbc124aa57
Fix searchDiscover handling invalid results (#1013)
* Filter out bad discover search results

An stub object is sometimes returned from the API that is marked as
`'external'` but has has no `'SearchResults'` key.

    {'id': 'external', 'title': 'More Ways To Watch', 'size': 0}

* Wrap line to fit 127c

* Ensure empty array for SearchResult
2022-08-27 06:24:10 -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
d1211722c8
Use pagination for /all endpoints (#990) 2022-08-26 22:45:15 -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
950e8c2960
Add workflow dispatch to CI workflow (#1011) 2022-08-26 09:27:05 -07:00
dependabot[bot]
656a6b34e5
Bump websocket-client from 1.3.3 to 1.4.0 (#1015)
Bumps [websocket-client](https://github.com/websocket-client/websocket-client) from 1.3.3 to 1.4.0.
- [Release notes](https://github.com/websocket-client/websocket-client/releases)
- [Changelog](https://github.com/websocket-client/websocket-client/blob/master/ChangeLog)
- [Commits](https://github.com/websocket-client/websocket-client/compare/v1.3.3...v1.4.0)

---
updated-dependencies:
- dependency-name: websocket-client
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-26 09:14:56 -07:00
dependabot[bot]
ba5fecfc75
Bump actions/cache from 3.0.6 to 3.0.8 (#1014)
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.6 to 3.0.8.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.6...v3.0.8)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-26 09:14:31 -07:00
JonnyWong16
b919c20e69
Release 4.12.1 2022-08-05 20:26:37 -07:00
JonnyWong16
bb860ef3d4
Remove timeout argument from preferred_connections (#1005) 2022-08-05 20:16:29 -07:00
dependabot[bot]
c3f256eb11
Bump actions/cache from 3.0.5 to 3.0.6 (#1003)
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.5 to 3.0.6.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.5...v3.0.6)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-05 19:53:35 -07:00
dependabot[bot]
6ee2b2c730
Bump flake8 from 4.0.1 to 5.0.4 (#1002)
Bumps [flake8](https://github.com/pycqa/flake8) from 4.0.1 to 5.0.4.
- [Release notes](https://github.com/pycqa/flake8/releases)
- [Commits](https://github.com/pycqa/flake8/compare/4.0.1...5.0.4)

---
updated-dependencies:
- dependency-name: flake8
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-05 19:53:20 -07:00
JonnyWong16
db03046d2c
Fix resource mixins to use ratingKey instead of key (#992) 2022-08-05 19:53:06 -07:00
JonnyWong16
bf0ba67974
Update search operator docs (#993) 2022-08-05 19:52:51 -07:00
JonnyWong16
22dcd5dc5d
Remove unused timeout parameter from preferred_connections doc string (#987) 2022-08-05 19:52:34 -07:00
Rui Carmo
a7e87a583f
Expose callbackError parameter in PlexServer.startAlertListener() (#985)
* Expose callbackError

This makes it easier to catch errors without separately instantiating an AlertListener

* Update docstring.

* Fix docstring

Removed post-argument note, incorporated suggestion.
2022-08-05 19:52:09 -07:00
JonnyWong16
3a56c69078
Release 4.12.0 2022-07-20 20:56:58 -07:00
jjlawren
cb05a81997
Remove Python 3.6 support (#963)
* Remove Python 3.6 support

* Remove unused import
2022-07-20 20:19:56 -07:00
dependabot[bot]
f99b42b126
Bump requests from 2.27.1 to 2.28.1 (#973)
Bumps [requests](https://github.com/psf/requests) from 2.27.1 to 2.28.1.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.27.1...v2.28.1)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-20 20:19:47 -07:00
JonnyWong16
13282f157b
Use fetchItem for MyPlexAccount.userState() (#982) 2022-07-20 20:12:30 -07:00
JonnyWong16
71d11a4280
Fix Artists.matches() when searching by title (#981) 2022-07-20 20:10:25 -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
d09cc47562
Use /related endpoint for hubs (#978) 2022-07-20 19:49:11 -07:00
JonnyWong16
f5673294c7
Remove check for playQueueType when adding items to a PlayQueue (#977)
* Remove check for playQueueType when adding items to a PlayQueue

* Fix PlayQueue doc strings
2022-07-20 19:49:02 -07:00
JonnyWong16
9f7f11ba9c
Add support for Plex OAuth (#974)
* Add method to return Plex OAuth url

* Add helper utils function for Plex OAuth
2022-07-20 19:48:52 -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
76240dc7a8
Add method to switch Plex Home users (#958)
* Add method to switch Plex Home users

* Update user parameter types in doc strings
2022-07-20 19:05:29 -07:00
Matt McDowall
188b4a4e7e
Define ratingCount attribute in doc (#955) 2022-07-20 19:03:00 -07:00
dependabot[bot]
4ceedfbadf
Bump actions/cache from 3.0.4 to 3.0.5 (#980)
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.4 to 3.0.5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.4...v3.0.5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-20 18:08:46 -07:00
dependabot[bot]
e718a0fc68
Update pytest-mock requirement from <3.7.1 to <3.8.3 (#976)
Updates the requirements on [pytest-mock](https://github.com/pytest-dev/pytest-mock) to permit the latest version.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v0.1.0...v3.8.2)

---
updated-dependencies:
- dependency-name: pytest-mock
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-20 18:08:39 -07:00
dependabot[bot]
6b743fd7e4
Bump pillow from 9.1.1 to 9.2.0 (#975)
Bumps [pillow](https://github.com/python-pillow/Pillow) from 9.1.1 to 9.2.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/9.1.1...9.2.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-20 18:08:31 -07:00
JonnyWong16
ae78557931
Fix show studio test (#979) 2022-07-20 17:00:55 -07:00
dependabot[bot]
2b960cf868
Bump websocket-client from 1.3.2 to 1.3.3 (#966)
Bumps [websocket-client](https://github.com/websocket-client/websocket-client) from 1.3.2 to 1.3.3.
- [Release notes](https://github.com/websocket-client/websocket-client/releases)
- [Changelog](https://github.com/websocket-client/websocket-client/blob/master/ChangeLog)
- [Commits](https://github.com/websocket-client/websocket-client/compare/v1.3.2...v1.3.3)

---
updated-dependencies:
- dependency-name: websocket-client
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-28 17:02:28 -05:00
JonnyWong16
f361b29973
Fix movie year test (#967) 2022-06-20 09:01:27 -07:00
dependabot[bot]
e91715aec8
Bump actions/setup-python from 3 to 4 (#961)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-11 09:21:27 -05:00
dependabot[bot]
c11f63641e
Bump actions/cache from 3.0.2 to 3.0.4 (#960)
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.2 to 3.0.4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.2...v3.0.4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-11 09:20:36 -05:00
JonnyWong16
9e918a43a7
Release 4.11.2 2022-05-30 09:06:09 -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
f16058fa03
Minor improvements to fetching season/show (#950)
* Check parentIndex is an integer for Episode.seasonEpisode

* Saves an extra API call to `season()` for Season 0 (Specials)

* Use parentKey and grandparentKey to fetch show
2022-05-30 09:01:55 -07:00
JonnyWong16
f7f2b6b115
Make sure PlexObject private attributes are set before loading data (#946) 2022-05-30 08:53:27 -07:00
jjlawren
e78835b234 Release 4.11.1 2022-05-19 14:48:39 -05:00