mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-25 13:10:17 +00:00
Add tests for smart collection/playlist filters
This commit is contained in:
parent
dd0e3789f6
commit
e51d8253f3
2 changed files with 34 additions and 0 deletions
|
@ -184,6 +184,24 @@ def test_Collection_createSmart(plex, tvshows):
|
|||
collection.delete()
|
||||
|
||||
|
||||
def test_Collection_smartFilters(plex, tvshows):
|
||||
title = "test_Collection_smartFilters"
|
||||
try:
|
||||
collection = plex.createCollection(
|
||||
title=title,
|
||||
section=tvshows,
|
||||
smart=True,
|
||||
limit=5,
|
||||
libtype="episode",
|
||||
sort=["season.index:nullsLast", "episode.index:nullsLast", "show.titleSort"],
|
||||
filters={"or": [{"show.title": "game"}, {'show.title': "100"}]}
|
||||
)
|
||||
filters = collection.filters()
|
||||
assert tvshows.search(**filters) == collection.items()
|
||||
finally:
|
||||
collection.delete()
|
||||
|
||||
|
||||
def test_Collection_exceptions(plex, movies, movie, artist):
|
||||
title = 'test_Collection_exceptions'
|
||||
try:
|
||||
|
|
|
@ -182,6 +182,22 @@ def test_Playlist_createSmart(plex, movies, movie):
|
|||
playlist.delete()
|
||||
|
||||
|
||||
def test_Playlist_smartFilters(plex, tvshows):
|
||||
try:
|
||||
playlist = plex.createPlaylist(
|
||||
title="smart_playlist_filters",
|
||||
smart=True,
|
||||
section=tvshows,
|
||||
limit=5,
|
||||
sort=["season.index:nullsLast", "episode.index:nullsLast", "show.titleSort"],
|
||||
filters={"or": [{"show.title": "game"}, {'show.title': "100"}]}
|
||||
)
|
||||
filters = playlist.filters()
|
||||
assert tvshows.search(**filters) == playlist.items()
|
||||
finally:
|
||||
playlist.delete()
|
||||
|
||||
|
||||
def test_Playlist_section(plex, movies, movie):
|
||||
title = 'test_playlist_section'
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue