|
2 | 2 | import os |
3 | 3 | from urllib.parse import quote_plus, urlencode |
4 | 4 |
|
5 | | -from plexapi import library, media, settings, utils |
| 5 | +from plexapi import library, media, utils |
6 | 6 | from plexapi.base import Playable, PlexPartialObject |
7 | | -from plexapi.exceptions import BadRequest, NotFound |
8 | | -from plexapi.mixins import ArtUrlMixin, ArtMixin, BannerMixin, PosterUrlMixin, PosterMixin |
| 7 | +from plexapi.exceptions import BadRequest |
| 8 | +from plexapi.mixins import AdvancedSettingsMixin, ArtUrlMixin, ArtMixin, BannerMixin, PosterUrlMixin, PosterMixin |
9 | 9 | from plexapi.mixins import SplitMergeMixin, UnmatchMatchMixin |
10 | 10 | from plexapi.mixins import CollectionMixin, CountryMixin, DirectorMixin, GenreMixin, LabelMixin, ProducerMixin, WriterMixin |
11 | 11 |
|
@@ -248,7 +248,7 @@ def sync(self, videoQuality, client=None, clientId=None, limit=None, unwatched=F |
248 | 248 |
|
249 | 249 |
|
250 | 250 | @utils.registerPlexObject |
251 | | -class Movie(Video, Playable, ArtMixin, PosterMixin, SplitMergeMixin, UnmatchMatchMixin, |
| 251 | +class Movie(Video, Playable, AdvancedSettingsMixin, ArtMixin, PosterMixin, SplitMergeMixin, UnmatchMatchMixin, |
252 | 252 | CollectionMixin, CountryMixin, DirectorMixin, GenreMixin, LabelMixin, ProducerMixin, WriterMixin): |
253 | 253 | """ Represents a single Movie. |
254 | 254 |
|
@@ -381,7 +381,7 @@ def download(self, savepath=None, keep_original_name=False, **kwargs): |
381 | 381 |
|
382 | 382 |
|
383 | 383 | @utils.registerPlexObject |
384 | | -class Show(Video, ArtMixin, BannerMixin, PosterMixin, SplitMergeMixin, UnmatchMatchMixin, |
| 384 | +class Show(Video, AdvancedSettingsMixin, ArtMixin, BannerMixin, PosterMixin, SplitMergeMixin, UnmatchMatchMixin, |
385 | 385 | CollectionMixin, GenreMixin, LabelMixin): |
386 | 386 | """ Represents a single Show (including all seasons and episodes). |
387 | 387 |
|
@@ -489,41 +489,6 @@ def isWatched(self): |
489 | 489 | """ Returns True if the show is fully watched. """ |
490 | 490 | return bool(self.viewedLeafCount == self.leafCount) |
491 | 491 |
|
492 | | - def preferences(self): |
493 | | - """ Returns a list of :class:`~plexapi.settings.Preferences` objects. """ |
494 | | - items = [] |
495 | | - data = self._server.query(self._details_key) |
496 | | - for item in data.iter('Preferences'): |
497 | | - for elem in item: |
498 | | - setting = settings.Preferences(data=elem, server=self._server) |
499 | | - setting._initpath = self.key |
500 | | - items.append(setting) |
501 | | - |
502 | | - return items |
503 | | - |
504 | | - def editAdvanced(self, **kwargs): |
505 | | - """ Edit a show's advanced settings. """ |
506 | | - data = {} |
507 | | - key = '%s/prefs?' % self.key |
508 | | - preferences = {pref.id: list(pref.enumValues.keys()) for pref in self.preferences()} |
509 | | - for settingID, value in kwargs.items(): |
510 | | - enumValues = preferences.get(settingID) |
511 | | - if value in enumValues: |
512 | | - data[settingID] = value |
513 | | - else: |
514 | | - raise NotFound('%s not found in %s' % (value, enumValues)) |
515 | | - url = key + urlencode(data) |
516 | | - self._server.query(url, method=self._server._session.put) |
517 | | - |
518 | | - def defaultAdvanced(self): |
519 | | - """ Edit all of show's advanced settings to default. """ |
520 | | - data = {} |
521 | | - key = '%s/prefs?' % self.key |
522 | | - for preference in self.preferences(): |
523 | | - data[preference.id] = preference.default |
524 | | - url = key + urlencode(data) |
525 | | - self._server.query(url, method=self._server._session.put) |
526 | | - |
527 | 492 | def hubs(self): |
528 | 493 | """ Returns a list of :class:`~plexapi.library.Hub` objects. """ |
529 | 494 | data = self._server.query(self._details_key) |
|
0 commit comments