Commit graph

77 commits

Author SHA1 Message Date
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
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
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
d248f1418b
Fix test track ratingCount attribute (#898) 2022-03-17 14:57:25 -05: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
59638dc714
Add new methods to edit object fields (#876)
* Update Collection.edit() method

* Add new EditFieldMixin and subclasses

* Add EditFieldMixin to Plex objects

* Update PlexPartialObject.edit() doc string

* Cast Track parentIndex to int

* Add base _searchTypes property

* Add kwargs to editField

* Editing album title also requires the artist ratingKey

* Add tests for editing fields

* Deprecate Collection.edit()

* Make editing fields chainable

* Add chaining example to doc string

* Add batch editing mode

* Add test for batchEdits

* Clean up mixins imports

* Reorder mixins

* Fix tests for batch edit
2022-02-26 21:40:51 -08:00
JonnyWong16
a568819e1e
Add tests for theme mixin (#897)
* Add lockTheme and unlockTheme methods

* Change setTheme to raise NotImplementedError

* Add tests for theme mixins
2022-02-26 21:05:43 -08:00
meisnate12
2f101e3899
Add LabelMixin to Season, Episode, Artist, and Track objects (#872)
* Add LabelMixin to Episode class

* Add test_mixins.edit_label(episode) test

* Add Label Mixin to Season, Artist,and Track

* fix tests

* Load manual FilteringFields for labels

* Load manual FilteringFilters for labels

Co-authored-by: Elan Ruusamäe <glen@pld-linux.org>
Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
2022-02-26 17:32:18 -08:00
JonnyWong16
a9ffd1e738
Fix image mixins tests (#856)
* Unlock images after edit image test

* Enable playlist art mixins tests

* Mark all image mixins tests as xfail

* Changing images can fail randomly
2021-11-20 17:14:34 -08:00
JonnyWong16
01131c95cf
Cleanup download methods (#847)
* Add utils.cleanFilename

* Refactor download methods

* Add option to download episodes, tracks, photos into subfolders

* Update download tests

* Test download keep_original_filename
2021-11-20 14:16:58 -08:00
JonnyWong16
bf3f0c1392
Merge branch 'master' into feature/album_types 2021-10-04 14:13:39 -07:00
JonnyWong16
3fce24587d
Merge pull request #810 from JonnyWong16/feature/web_url
Add methods to retrieve the Plex Web URL
2021-10-04 12:38:24 -07:00
JonnyWong16
1efe0a908d
Update audio tests 2021-09-16 15:24:09 -07:00
JonnyWong16
692a23586c
Add methods to lock and unlock artwork and posters (#825)
* Add private _edit method

* Add fields attribute to playlists

* Add lock and unlock methods to art, banner, and poster mixins

* Add tests for locking and unlocking art and posters
2021-09-12 19:56:21 -05:00
JonnyWong16
3bebeaacd5
Add tests for Plex Web URLs 2021-08-25 18:10:11 -07:00
JonnyWong16
bd8cdb10b7 Update tests for ratings mixin 2021-05-30 15:49:45 -07:00
JonnyWong16
c76b2d4027
Merge remote-tracking branch 'upstream/master' into feature/multi_sort 2021-05-23 20:39:08 -07:00
JonnyWong16
c4522d9c6b
Merge pull request #746 from JonnyWong16/feature/properties
Add episodeNumber, trackNumber, and hasPreviewThumbnails helper properties
2021-05-23 19:02:20 -07:00
JonnyWong16
85e58feb33
Update tests for lastRatedAt 2021-05-15 22:38:54 -07:00
JonnyWong16
ac7becd27f
Add tests for episodeNumber and trackNumber properties 2021-05-10 18:13:31 -07:00
JonnyWong16
71e7ee2660
Add tests for media tags 2021-05-09 20:03:12 -07:00
JonnyWong16
e877b0039b
Add tests for Season, Episode, and Track collection tags 2021-05-09 12:27:38 -07:00
meisnate12
5584ef1d4f
Added AdvancedSettingsMixin (#714)
* Added AdvancedSettingsMixin

* forgot import

* shortened line

* remove whitespace

* removed unused import

* reordered mixins

* Add preference method to AdvancedSettingsMixin

* Add tests for AdvancedSettingsMixin

Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
2021-04-05 15:44:49 -05:00
JonnyWong16
c15133da88
Adds Movie and Artist advanced setting attributes (#680)
* Add advanced setting attributes to movie

* Add advanced setting attributes to artist

* Update tests for movie advanced setting attributes

* Update tests for artist advanced setting attributes

* Fix artist albumSort attribute
2021-03-11 11:20:28 -06:00
JonnyWong16
88dbee7508
Fix flake8 2021-02-14 22:41:17 -08:00
JonnyWong16
9fde559147
Remove redundant audio tests 2021-02-14 21:20:27 -08:00
JonnyWong16
c537db61cf
Factor out mixins image url tests 2021-02-14 21:19:42 -08:00
JonnyWong16
8915134b6b
Fix typo in track test 2021-02-14 19:11:53 -08:00
JonnyWong16
8478ae6e62
Add banner url to show tests 2021-02-14 19:03:19 -08:00
JonnyWong16
bbafaee1cf
Update art and thumb tests 2021-02-14 17:10:11 -08:00
JonnyWong16
427d90bd3b
Add mixins tests for all objects with art and posters 2021-02-14 15:59:57 -08:00
JonnyWong16
c23d9635f5
Rename to mixins 2021-01-24 15:03:23 -08:00
JonnyWong16
deda4e1b2b
Add mixin tag tests 2021-01-24 14:40:39 -08:00
blacktwin
4f0910ab79
Update to MediaPartStream and inheriting classes (#590)
* moving common child (VideoStream, AudioStream, SubtitleStream) attributes to the parent (MediaPartStream)

* removal of no longer present attribs in video, audio, subtitle streams

* additional attribs to video and mediapart streams

* removal of previously unique subtitleStream attribs. attribs are now common or no longer present.

* docstring cleanup of video, audio, and subtitle stream; pass 1

* remove codecID checks as this attribute is now longer used.

* adding key attrib to parent MediaPartStream.

* add transient to SubtitleStream, found in uploaded subtitles

* removing dialogNorm related assertion as this attrib has been removed.

* update Media class based on PR comments
optimizedVersion to be added, need SEARCHTYPES

* update MediaPartStream class based on PR comments

* update VideoStream class based on PR comments

* update AudioStream class based on PR comments

* update SubtitleStream class based on PR comments

* add LyricStream class based on PR comments

* add streamType int and LyricStream to MediaPartStream.parse method

* add MediaPart.lyricStreams method

* spelling correction

* more movement based on PR comments

* alpha ordering MediaPart

* alpha sort VideoStream

* docstring corrections

* remove assert stream.dialogNorm from audio test as dialogNorm has been removed.

* adding LyricStream to _buildStreams function

* adding changes from @johnnywong16
e346f0b4dc

* moving unused imports down and together

* Address docstring review comments

* Change isChildOf for any kwargs

* Add Media.isOptimizedVersion property

* Add photo and track specific attributes

* Remove dead MediaPartStream.parse method

* Update media doc strings

* Add optimized version doc string

* Cast video stream codedHeight and codedWidth to int

* Add required bandwidths to streams

* Update video tests

* Update audio tests

* Fix video tests

* Fix video tests

* Fix video tests

Co-authored-by: Jason Lawrence <jjlawren@users.noreply.github.com>
Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
2021-01-24 15:21:56 -05:00
JonnyWong16
33b725d8d4
Update tests 2020-12-23 23:03:08 -08:00
JonnyWong16
22bfeb0820
Update test_audio index is integer 2020-12-23 16:56:00 -08:00
jjlawren
623229bd38
Fix country metadata test (#614) 2020-12-03 17:18:35 -06:00
Jason Lawrence
576dc21992 Handle empty datetimes in tests 2020-10-08 15:15:43 -05:00
jjlawren
24901302d7
New bootstrap music scanner (#571)
* Use new Plex Music metadata scanner in tests

* Update tests to match Plex Music scanner metadata

* More tweaks to audio metadata matching

* Another tweak
2020-09-16 17:58:36 -05:00
jjlawren
fc54f7fe06
Add guards for missing thumbs in tests (#548) 2020-08-07 16:57:04 -05:00
Hellowlol
c9052ef933 fix audio test
run black on some tests
2020-04-30 00:49:11 +03:00
Hellowlol
0520ca7390 Update test_audio.py 2020-04-30 00:44:59 +03:00
Hellowlol
47367292f2 Fix some audio test
Make some attributes tests less strict and they tend fail some time to time.
2020-04-30 00:44:59 +03:00
Jason Lawrence
06e6386ea3 Minor test fixes 2020-04-16 12:07:40 -05:00
Hellowlol
cc71daeaba sync 2020-04-15 20:41:15 +02:00
Hellowlol
6741be06c4 fix tests 2020-04-14 22:13:30 +02:00
zSeriesGuy
f3091d9e97 Remove markwatched/markunwatched from audio tests history 2019-11-14 13:44:42 -05:00
zSeriesGuy
43a60f00f1 Support history for specific ratingKeys
Add history method to PlexPartialObject
Add ratingKey to server history method.
Add tests for movie, show, season, episode, artist, album, and track history.
2019-11-14 12:21:49 -05:00
Michael Shepanski
1709868665 Its hit or miss.. 2019-10-16 00:15:06 -04:00
Michael Shepanski
44eed792c7 Assuming bar.update is not threadsafe.
Fix electronic tag.
Fix media duration off by 1.
2019-10-15 23:49:27 -04:00