Skip to content

Commit ca13bca

Browse files
authored
Remove DeprecationWarning for watched methods (#1306)
* Remove deprecation warnings for watched * Test alias watched methods
1 parent 1c591f6 commit ca13bca

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

plexapi/mixins.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,19 +316,16 @@ def markUnplayed(self):
316316
return self
317317

318318
@property
319-
@deprecated('use "isPlayed" instead', stacklevel=3)
320319
def isWatched(self):
321-
""" Returns True if the show is watched. """
320+
""" Alias to self.isPlayed. """
322321
return self.isPlayed
323322

324-
@deprecated('use "markPlayed" instead')
325323
def markWatched(self):
326-
""" Mark the video as played. """
324+
""" Alias to :func:`~plexapi.mixins.PlayedUnplayedMixin.markPlayed`. """
327325
self.markPlayed()
328326

329-
@deprecated('use "markUnplayed" instead')
330327
def markUnwatched(self):
331-
""" Mark the video as unplayed. """
328+
""" Alias to :func:`~plexapi.mixins.PlayedUnplayedMixin.markUnplayed`. """
332329
self.markUnplayed()
333330

334331

tests/test_video.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,13 @@ def test_video_movie_watched(movie):
351351
movie.reload()
352352
assert movie.viewCount == 0
353353

354+
movie.markWatched()
355+
movie.reload()
356+
assert movie.viewCount == 1
357+
movie.markUnwatched()
358+
movie.reload()
359+
assert movie.viewCount == 0
360+
354361

355362
def test_video_Movie_isPartialObject(movie):
356363
assert movie.isPartialObject()
@@ -873,12 +880,14 @@ def test_video_Show_markPlayed(show):
873880
show.markPlayed()
874881
show.reload()
875882
assert show.isPlayed
883+
assert show.isWatched
876884

877885

878886
def test_video_Show_markUnplayed(show):
879887
show.markUnplayed()
880888
show.reload()
881889
assert not show.isPlayed
890+
assert not show.isWatched
882891

883892

884893
def test_video_Show_refresh(show):

0 commit comments

Comments
 (0)