def ajax_listmyvideo_do(rd, data, user): order = getDefaultJSON(data, 'order', 'latest') if order not in ['latest', 'oldest', 'video_latest', 'video_oldest']: raise AttributeError() videos, video_count = listMyVideo(data.page - 1, data.page_size, user, order) ret = makeResponseSuccess({ "videos": videos, "count": video_count, "tags": getCommonTagsWithCount('CHS', videos), "page_count": (video_count - 1) // data.page_size + 1, }) return "json", ret
def ajax_listmyvideo_do(rd, data, user): order = getDefaultJSON(data, 'order', 'latest') lang = getDefaultJSON(data, 'lang', 'CHS') offset, limit = getOffsetLimitJSON(data) videos, video_count = listMyVideo(offset, limit, user, order, user_language=lang) ret = makeResponseSuccess({ "videos": videos, "count": video_count, "tags": getCommonTagsWithCount(lang, videos), "page_count": (video_count - 1) // limit + 1, }) return "json", ret