def test_play_photos(account, plex): client = getclient('iphone-mike', CONFIG.client_baseurl, plex) photosection = plex.library.section(CONFIG.photo_section) album = photosection.get(CONFIG.photo_album) photos = album.photos() for photo in photos[:4]: client.playMedia(photo) time.sleep(2)
def test_playlist_photos(account, plex): client = getclient('iphone-mike', CONFIG.client_baseurl, plex) photosection = plex.library.section(CONFIG.photo_section) album = photosection.get(CONFIG.photo_album) photos = album.photos() playlist = plex.createPlaylist('test_play_playlist2', photos) try: client.playMedia(playlist) for i in range(3): time.sleep(2) client.skipNext(mtype='photo') finally: playlist.delete()
def test_playlist(account, plex): client = getclient(CONFIG.client, CONFIG.client_baseurl, plex) artist = plex.library.section(CONFIG.audio_section).get( CONFIG.audio_artist) album = artist.album(CONFIG.audio_album) playlist = plex.createPlaylist('test_play_playlist', album) try: log(2, 'Playing playlist: %s' % playlist) client.playMedia(playlist) time.sleep(5) log(2, 'stop..') client.stop('music') time.sleep(1) finally: playlist.delete()
def test_sessions(account, plex): client, movie = None, None try: mtype = 'video' movie = plex.library.section(CONFIG.movie_section).get(CONFIG.movie_title) client = getclient(CONFIG.client, CONFIG.client_baseurl, plex) log(2, 'Playing %s..' % movie.title) client.playMedia(movie); time.sleep(5) sessions = plex.sessions() for item in sessions[:20]: log(2, "%s is playing %s '%s' on %s" % (item.username, item.TYPE, item.title, item.player.platform)) assert len(sessions), 'No session items have been found.' finally: log(2, 'Stop..') if client: client.stop(mtype); time.sleep(1) log(2, 'Cleanup: Marking %s watched.' % movie.title) if movie: movie.markWatched()
def _test_timeline(plex, client): try: mtype = 'video' client = getclient(CONFIG.client, CONFIG.client_baseurl, plex) movie = plex.library.section(CONFIG.movie_section).get( CONFIG.movie_title) time.sleep(30) # previous test may have played media.. playing = client.isPlayingMedia() log(2, 'Playing Media: %s' % playing) assert playing is False, 'isPlayingMedia() should have returned False.' client.playMedia(movie) time.sleep(30) playing = client.isPlayingMedia() log(2, 'Playing Media: %s' % playing) assert playing is True, 'isPlayingMedia() should have returned True.' client.stop(mtype) time.sleep(30) playing = client.isPlayingMedia() log(2, 'Playing Media: %s' % playing) assert playing is False, 'isPlayingMedia() should have returned False.' finally: log(2, 'Cleanup: Marking %s watched.' % movie.title) movie.markWatched()
def test_video_playback_via_proxy(account, plex): client = getclient(CONFIG.client, CONFIG.client_baseurl, plex) client.proxyThroughServer() _video_playback(plex, client)
def test_video_playback(account, plex): client = getclient(CONFIG.client, CONFIG.client_baseurl, plex) _video_playback(plex, client)
def test_client_navigation_via_proxy(account, plex): client = getclient(CONFIG.client, CONFIG.client_baseurl, plex) client.proxyThroughServer() _navigate(plex, client)
def test_client_navigation(account, plex): client = getclient(CONFIG.client, CONFIG.client_baseurl, plex) _navigate(plex, client)
def test_client_timeline_via_proxy(account, plex): client = getclient(CONFIG.client, CONFIG.client_baseurl, plex) client.proxyThroughServer() _test_timeline(plex, client)
def test_client_timeline(account, plex): client = getclient(CONFIG.client, CONFIG.client_baseurl, plex) _test_timeline(plex, client)