public List<Video> getVideoList(VideoListQuery query)
{
var url = apiUrl + "/api/" + username + "/videos.json?count=" + query.count.ToString();
if (query.labels.Length > 0)
{
var outh = new OAuthBase();
url += "&labels=" + outh.UrlEncode(String.Join(",", query.labels));
}
if (query.status != String.Empty)
{
url += "&status=" + query.status;
}
if (query.sort == VideoListSorting.ASCENDING)
{
url += "&sort=" + "asc";
}
else
{
url += "&sort=" + "desc";
}
if (query.title != String.Empty)
{
url += "&title=" + HttpUtility.UrlEncode(query.title);
}
url += "&page=" + ((query.page > 1) ? query.page : 1);
var response = executeRequest(url);
var jo = (JArray)JsonConvert.DeserializeObject(response);
var result = new List<Video>();
foreach (var o in jo)
{
var video = new Video
{
status = (string)o["status"],
statusId = String.IsNullOrEmpty(o["status_id"].ToString()) ? 0 : int.Parse(o["status_id"].ToString()),
duration = String.IsNullOrEmpty(o["duration"].ToString()) ? 0 : decimal.Parse(o["duration"].ToString()),
description = (string)o["description"],
height = string.IsNullOrEmpty(o["height"].ToString()) ? 0 : int.Parse(o["height"].ToString()),
createdAt = DateTime.Parse((string)o["created_at"].ToString()),
width = string.IsNullOrEmpty(o["width"].ToString()) ? 0 : int.Parse(o["width"].ToString()),
playCount = String.IsNullOrEmpty(o["play_count"].ToString()) ? 0 : Int64.Parse(o["play_count"].ToString()),
version = (string)o["version"],
thumbnail = (string)o["thumbnail"],
url = (string)o["url"],
id = String.IsNullOrEmpty(o["id"].ToString()) ? 0 : Int64.Parse(o["id"].ToString()),
title = (string)o["title"],
user = new VideoAuthor
{
videoCount = String.IsNullOrEmpty(o["user"]["video_count"].ToString()) ? 0 : Int64.Parse(o["user"]["video_count"].ToString()),
name = (string)o["user"]["author_name"],
account = String.IsNullOrEmpty(o["user"]["author_account"].ToString()) ? 0 : int.Parse(o["user"]["author_account"].ToString()),
url = (string)o["user"]["author_url"]
}
};
result.Add(video);
}
return result;
}
public UploadSignature getUploadSignature(UploadSignatureQuery query)