def test_show_videos_specific_seasons_shows_videos(self): player = vrtplayer.VRTPlayer( None, self._kodi_wrapper, None, vrtapihelper.VRTApiHelper(self._kodi_wrapper)) player.show_episodes( '/vrtnu/a-z/thuis/24.lists.all-episodes.relevant/') self.assertTrue(self._kodi_wrapper.show_listing.called)
def router(params_string): ''' This is the main router for the video plugin menu ''' addon = xbmcaddon.Addon() kodi_wrapper = kodiwrapper.KodiWrapper(_ADDON_HANDLE, _ADDON_URL, addon) token_resolver = tokenresolver.TokenResolver(kodi_wrapper) stream_service = streamservice.StreamService( vrtplayer.VRTPlayer.VRT_BASE, vrtplayer.VRTPlayer.VRTNU_BASE_URL, kodi_wrapper, token_resolver) api_helper = vrtapihelper.VRTApiHelper(kodi_wrapper) vrt_player = vrtplayer.VRTPlayer(addon.getAddonInfo('path'), kodi_wrapper, stream_service, api_helper) params = dict(parse_qsl(params_string)) action = params.get('action') if action == actions.LISTING_AZ_TVSHOWS: vrt_player.show_tvshow_menu_items(path=None) elif action == actions.LISTING_CATEGORIES: vrt_player.show_category_menu_items() elif action == actions.LISTING_LIVE: vrt_player.show_livestream_items() elif action == actions.LISTING_EPISODES: vrt_player.show_episodes(params.get('video_url')) elif action == actions.LISTING_CATEGORY_TVSHOWS: vrt_player.show_tvshow_menu_items(path=params.get('video_url')) elif action == actions.LISTING_TVGUIDE: tv_guide = tvguide.TVGuide(addon.getAddonInfo('path'), kodi_wrapper) tv_guide.show_tvguide(params) elif action == actions.PLAY: video = dict( video_url=params.get('video_url'), video_id=params.get('video_id'), publication_id=params.get('publication_id'), ) vrt_player.play(video) else: vrt_player.show_main_menu_items()
def router(params_string): addon = xbmcaddon.Addon() kodi_wrapper = kodiwrapper.KodiWrapper(_handle, _url, addon) stream_service = urltostreamservice.UrlToStreamService( vrtplayer.VRTPlayer._VRT_BASE, vrtplayer.VRTPlayer._VRTNU_BASE_URL, kodi_wrapper) vrt_player = vrtplayer.VRTPlayer(addon.getAddonInfo("path"), kodi_wrapper, stream_service) params = dict(parse_qsl(params_string)) if params: if params['action'] == actions.LISTING_AZ: vrt_player.show_az_menu_items() elif params['action'] == actions.LISTING_CATEGORIES: vrt_player.show_category_menu_items() elif params['action'] == actions.LISTING_LIVE: vrt_player.show_livestream_items() elif params['action'] == actions.LISTING_VIDEOS: vrt_player.show_videos(params['video']) elif params['action'] == actions.LISTING_CATEGORY_VIDEOS: vrt_player.show_video_category_episodes(params['video']) elif params['action'] == actions.PLAY: vrt_player.play_vrtnu_video(params['video']) elif params['action'] == actions.PLAY_LIVE: vrt_player.play_livestream(params['video']) else: vrt_player.show_main_menu_items()
def router(params_string): addon = xbmcaddon.Addon() kodi_wrapper = kodiwrapper.KodiWrapper(_handle, _url, addon) vrt_player = vrtplayer.VRTPlayer(addon, addon.getAddonInfo("path")) params = dict(parse_qsl(params_string)) if params: if params['action'] == actions.LISTING_AZ: kodi_wrapper.show_listing(vrt_player.get_az_menu_items(), sortmethod.ALPHABET) elif params['action'] == actions.LISTING_CATEGORIES: kodi_wrapper.show_listing(vrt_player.get_category_menu_items(), sortmethod.ALPHABET) elif params['action'] == actions.LISTING_LIVE: kodi_wrapper.show_listing(vrt_player.get_livestream_items(), sortmethod.ALPHABET) elif params['action'] == actions.LISTING_VIDEOS: kodi_wrapper.show_listing(vrt_player.get_videos(params['video'])) elif params['action'] == actions.LISTING_CATEGORY_VIDEOS: kodi_wrapper.show_listing( vrt_player.get_video_category_episodes(params['video']), sortmethod.ALPHABET) elif params['action'] == actions.PLAY: kodi_wrapper.play_video(params['video']) elif params['action'] == actions.PLAY_LIVE: kodi_wrapper.play_livestream(params['video']) else: kodi_wrapper.show_listing(vrt_player.get_main_menu_items(), sortmethod.ALPHABET)
def test_show_videos_single_season_shows_videos(self): player = vrtplayer.VRTPlayer( None, self._kodi_wrapper, None, vrtapihelper.VRTApiHelper(self._kodi_wrapper)) player.show_episodes( '/vrtnu/a-z/apocalyps--de-eerste-wereldoorlog/1/apocalyps--de-eerste-wereldoorlog-s1a3.relevant/' ) self.assertTrue(self._kodi_wrapper.show_listing.called)
def test_show_videos_single_episode_shows_videos(self): player = vrtplayer.VRTPlayer( None, self._kodi_wrapper, None, vrtapihelper.VRTApiHelper(self._kodi_wrapper)) self._kodi_wrapper.show_listing() player.show_episodes( '/vrtnu/a-z/tussen-nu-en-morgen/2018/tussen-nu-en-morgen.relevant/' ) self.assertTrue(self._kodi_wrapper.show_listing.called)
def test_show_videos_single_episode_shows_videos(self): mock = MagicMock() mock.show_listing() player = vrtplayer.VRTPlayer(None,mock,None) player.show_videos('https://www.vrt.be/vrtnu/a-z/tussen-nu-en-morgen/2018/tussen-nu-en-morgen/') self.assertTrue(mock.show_listing.called)
def test_show_videos_specific_seasons_shows_videos(self): mock = MagicMock() mock.show_listing() player = vrtplayer.VRTPlayer(None,mock,None) player.show_videos('/vrtnu/a-z/thuis/24.lists.all-episodes/') self.assertTrue(mock.show_listing.called)
def test_show_videos_multiple_seasons_shows_videos(self): mock = MagicMock() mock.show_listing() player = vrtplayer.VRTPlayer(None,mock,None) player.show_videos('https://www.vrt.be/vrtnu/a-z/thuis/24/thuis-s24a4478/') self.assertTrue(mock.show_listing.called)
def test_show_videos_single_season_shows_videos(self): mock = MagicMock() mock.show_listing() player = vrtplayer.VRTPlayer(None,mock,None) player.show_videos('https://www.vrt.be/vrtnu/a-z/apocalyps--de-eerste-wereldoorlog/1/apocalyps--de-eerste-wereldoorlog-s1a3/') self.assertTrue(mock.show_listing.called)
def test_show_videos_multiple_seasons_shows_videos(self): player = vrtplayer.VRTPlayer( None, self._kodi_wrapper, None, vrtapihelper.VRTApiHelper(self._kodi_wrapper)) player.show_episodes('vrtnu/a-z/animal-babies.relevant/') self.assertTrue(self._kodi_wrapper.show_listing.called)