* 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
* 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
* 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
* Move videoStreams, audioStreams, lyricStreams to Playable
* Add lyricStreams to Playable
* Simplify returning list of streams
* Add test for track.lyricStreams()
* 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>
* 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>
* 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>
* 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>
* 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
* 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>
* Fallback PlexServer _timeout to TIMEOUT
* Fallback PlexServer query timeout to self._timeout
* Refactor MyPlexAccount, PlexClient query() to use timeout from constructor
* 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
* Optimize methods to use library get/search
* Revert methods
* Fix reloading of episodes for missing parentRatingKey
* Add tests for LibrarySection.get with kwargs
* 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
* Update MyPlexAccount to use Plex API v2
* Update MyPlexAccount test
* Add rememberMe option to MyPlexAccount sign in
* Update MyPlexAccount do string
* 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
* 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
* 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
* 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