Example #1
0
def team_video_lang_list(context, video, max_items=6):
    """
    max_items: if there are more items than max_items, they will be truncated to X more.
    """
    return  {
        'sub_statuses': video_cache.get_video_languages_verbose(video.video_id, max_items)
        }
Example #2
0
def team_video_lang_list(context, video, max_items=6):
    """
    max_items: if there are more items than max_items, they will be truncated to X more.
    """
    return {
        'sub_statuses':
        video_cache.get_video_languages_verbose(video.video_id, max_items),
        'video':
        video
    }
Example #3
0
def team_video_lang_list(context, team_video_search_record, max_items=6):
    """
    max_items: if there are more items than max_items, they will be truncated to X more.
    """
    return {
        'sub_statuses':
        video_cache.get_video_languages_verbose(
            team_video_search_record.video_id, max_items),
        'search_record':
        team_video_search_record
    }
Example #4
0
def team_video_lang_list(context, model_or_search_record, max_items=6):
    """
    max_items: if there are more items than max_items, they will be truncated to X more.
    """

    if isinstance(model_or_search_record, TeamVideo):
        video_url = reverse(
            "teams:team_video",
            kwargs={"team_video_pk": model_or_search_record.pk})
    elif isinstance(model_or_search_record, Video):
        video_url = reverse(
            "videos:video",
            kwargs={"video_id": model_or_search_record.video_id})
    else:
        video_url = reverse(
            "teams:team_video",
            kwargs={"team_video_pk": model_or_search_record.team_video_pk})
    return {
        'sub_statuses':
        video_cache.get_video_languages_verbose(
            model_or_search_record.video_id, max_items),
        "video_url":
        video_url,
    }