mirror of
https://github.com/pkkid/python-plexapi
synced 2025-02-16 12:58:26 +00:00
Remove DeprecationWarning for watched methods (#1306)
* Remove deprecation warnings for watched * Test alias watched methods
This commit is contained in:
parent
1c591f6438
commit
ca13bcaf45
2 changed files with 12 additions and 6 deletions
|
@ -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()
|
||||
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue