mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-14 16:07:15 +00:00
add testing for optimizing videos
need sleep(1) to allow for conversion to go through.
This commit is contained in:
parent
0854325324
commit
3acc72d0c3
1 changed files with 18 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import pytest
|
||||
from datetime import datetime
|
||||
from time import sleep
|
||||
from plexapi.exceptions import BadRequest, NotFound
|
||||
from . import conftest as utils
|
||||
|
||||
|
@ -685,4 +686,20 @@ def test_video_exists_accessible(movie, episode):
|
|||
episode.reload()
|
||||
assert episode.media[0].parts[0].exists is True
|
||||
assert episode.media[0].parts[0].accessible is True
|
||||
|
||||
|
||||
|
||||
def test_video_optimize(movie, plex):
|
||||
plex.optimizedItems(removeAll=True)
|
||||
movie.optimize(targetTagID=1)
|
||||
sleep(1)
|
||||
assert len(plex.optimizedItems()) == 1
|
||||
assert len(plex.conversions()) == 1
|
||||
conversion = plex.conversions()[0]
|
||||
conversion.remove()
|
||||
assert len(plex.conversions()) == 0
|
||||
assert len(plex.optimizedItems()) == 1
|
||||
optimized = plex.optimizedItems()[0]
|
||||
video = plex.optimizedItem(optimizedID=optimized.id)
|
||||
assert movie.key == video.key
|
||||
plex.optimizedItems(removeAll=True)
|
||||
assert len(plex.optimizedItems()) == 0
|
Loading…
Reference in a new issue