Skip to content

Commit

Permalink
set content type to videos instead of episodes
Browse files Browse the repository at this point in the history
  • Loading branch information
anxdpanic committed Nov 26, 2016
1 parent 6023f78 commit 542cbfa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions resources/lib/kodion/constants/const_content_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
MOVIES = 'movies'
TV_SHOWS = 'tvshows'
EPISODES = 'episodes'
VIDEOS = 'videos'
MUSIC_VIDEOS = 'musicvideos'
14 changes: 7 additions & 7 deletions resources/lib/youtube/helper/yt_specials.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
def _process_related_videos(provider, context, re_match):
result = []

provider.set_content_type(context, kodion.constants.content_type.EPISODES)
provider.set_content_type(context, kodion.constants.content_type.VIDEOS)

page_token = context.get_param('page_token', '')
video_id = context.get_param('video_id', '')
Expand All @@ -24,7 +24,7 @@ def _process_related_videos(provider, context, re_match):


def _process_recommendations(provider, context, re_match):
provider.set_content_type(context, kodion.constants.content_type.EPISODES)
provider.set_content_type(context, kodion.constants.content_type.VIDEOS)
result = []

page_token = context.get_param('page_token', '')
Expand All @@ -36,7 +36,7 @@ def _process_recommendations(provider, context, re_match):


def _process_popular_right_now(provider, context, re_match):
provider.set_content_type(context, kodion.constants.content_type.EPISODES)
provider.set_content_type(context, kodion.constants.content_type.VIDEOS)

result = []

Expand Down Expand Up @@ -71,7 +71,7 @@ def _process_browse_channels(provider, context, re_match):


def _process_disliked_videos(provider, context, re_match):
provider.set_content_type(context, kodion.constants.content_type.EPISODES)
provider.set_content_type(context, kodion.constants.content_type.VIDEOS)
result = []

page_token = context.get_param('page_token', '')
Expand All @@ -86,7 +86,7 @@ def _process_live_events(provider, context, re_match):
def _sort(x):
return x.get_aired()

provider.set_content_type(context, kodion.constants.content_type.EPISODES)
provider.set_content_type(context, kodion.constants.content_type.VIDEOS)

result = []

Expand All @@ -102,7 +102,7 @@ def _sort(x):

def _process_description_links(provider, context, re_match):
def _extract_urls(_video_id):
provider.set_content_type(context, kodion.constants.content_type.EPISODES)
provider.set_content_type(context, kodion.constants.content_type.VIDEOS)

result = []

Expand Down Expand Up @@ -221,7 +221,7 @@ def _display_playlists(_playlist_ids):


def _process_new_uploaded_videos_tv(provider, context, re_match):
provider.set_content_type(context, kodion.constants.content_type.EPISODES)
provider.set_content_type(context, kodion.constants.content_type.VIDEOS)

result = []
next_page_token = context.get_param('next_page_token', '')
Expand Down
10 changes: 5 additions & 5 deletions resources/lib/youtube/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def on_uri2addon(self, context, re_match):

@kodion.RegisterProviderPath('^/playlist/(?P<playlist_id>.*)/$')
def _on_playlist(self, context, re_match):
self.set_content_type(context, kodion.constants.content_type.EPISODES)
self.set_content_type(context, kodion.constants.content_type.VIDEOS)

result = []

Expand All @@ -250,7 +250,7 @@ def _on_playlist(self, context, re_match):

@kodion.RegisterProviderPath('^/channel/(?P<channel_id>.*)/playlist/(?P<playlist_id>.*)/$')
def _on_channel_playlist(self, context, re_match):
self.set_content_type(context, kodion.constants.content_type.EPISODES)
self.set_content_type(context, kodion.constants.content_type.VIDEOS)

result = []

Expand Down Expand Up @@ -294,7 +294,7 @@ def _on_channel_playlists(self, context, re_match):

@kodion.RegisterProviderPath('^/(?P<method>(channel|user))/(?P<channel_id>.*)/$')
def _on_channel(self, context, re_match):
self.set_content_type(context, kodion.constants.content_type.EPISODES)
self.set_content_type(context, kodion.constants.content_type.VIDEOS)

resource_manager = self.get_resource_manager(context)

Expand Down Expand Up @@ -443,7 +443,7 @@ def on_search(self, search_text, context, re_match):
page = int(context.get_param('page', 1))

if search_type == 'video':
self.set_content_type(context, kodion.constants.content_type.EPISODES)
self.set_content_type(context, kodion.constants.content_type.VIDEOS)
pass

if page == 1 and search_type == 'video' and not event_type:
Expand Down Expand Up @@ -703,7 +703,7 @@ def on_root(self, context, re_match):
return result

def set_content_type(self, context, content_type):
if content_type == kodion.constants.content_type.EPISODES:
if content_type == kodion.constants.content_type.VIDEOS:
context.set_content_type(content_type)
context.add_sort_method(kodion.constants.sort_method.UNSORTED,
kodion.constants.sort_method.VIDEO_RUNTIME,
Expand Down

0 comments on commit 542cbfa

Please sign in to comment.