Remove DeprecationWarning for watched methods (#1306)

* Remove deprecation warnings for watched

* Test alias watched methods
This commit is contained in:
JonnyWong16 2023-12-22 12:48:56 -08:00 committed by GitHub
parent 1c591f6438
commit ca13bcaf45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 6 deletions

View file

@ -316,19 +316,16 @@ class PlayedUnplayedMixin:
return self
@property
@deprecated('use "isPlayed" instead', stacklevel=3)
def isWatched(self):
""" Returns True if the show is watched. """
""" Alias to self.isPlayed. """
return self.isPlayed
@deprecated('use "markPlayed" instead')
def markWatched(self):
""" Mark the video as played. """
""" Alias to :func:`~plexapi.mixins.PlayedUnplayedMixin.markPlayed`. """
self.markPlayed()
@deprecated('use "markUnplayed" instead')
def markUnwatched(self):
""" Mark the video as unplayed. """
""" Alias to :func:`~plexapi.mixins.PlayedUnplayedMixin.markUnplayed`. """
self.markUnplayed()

View file

@ -351,6 +351,13 @@ def test_video_movie_watched(movie):
movie.reload()
assert movie.viewCount == 0
movie.markWatched()
movie.reload()
assert movie.viewCount == 1
movie.markUnwatched()
movie.reload()
assert movie.viewCount == 0
def test_video_Movie_isPartialObject(movie):
assert movie.isPartialObject()
@ -873,12 +880,14 @@ def test_video_Show_markPlayed(show):
show.markPlayed()
show.reload()
assert show.isPlayed
assert show.isWatched
def test_video_Show_markUnplayed(show):
show.markUnplayed()
show.reload()
assert not show.isPlayed
assert not show.isWatched
def test_video_Show_refresh(show):