private void SetModel(NicoVideoModel video, bool reload) { VideoId = video.VideoId; if (video.Status == VideoStatus.Delete) { return; } if (!reload) { Title = video.Title; } Description = video.Description; ViewCounter = video.ViewCounter; MylistCounter = video.MylistCounter; CommentCounter = video.CommentCounter; StartTime = video.StartTime; TempTime = video.TempTime; LengthSeconds = TimeSpan.FromSeconds(video.LengthSeconds); Username = video.Username; Tags = video.Tags; RefreshVideoStatus(video.Status); }
private void SetModel(NicoVideoModel x) { VideoId = x.VideoId; Title = x.Title; Description = x.Description; ViewCounter = x.ViewCounter; MylistCounter = x.MylistCounter; CommentCounter = x.CommentCounter; StartTime = x.StartTime; TempTime = x.TempTime; LengthSeconds = x.LengthSeconds; Username = x.Username; Status = x.Status; Tags = x.Tags; }
private async void Intialize(NicoVideoModel x) { SetModel(x); var urls = new string[] { $"{x.ThumbnailUrl}.L", $"{x.ThumbnailUrl}.M", $"{x.ThumbnailUrl}", }; await NicoUtil .GetThumbnailAsync(urls) .ContinueWith(image => Thumbnail = image.Result); }
private async void Initialize(NicoVideoModel video, bool reload) { SetModel(video, false); if (reload) { await NicoUtil .GetVideo(VideoId) .ContinueWith(x => SetModel(x.Result, true)); } var urls = new string[] { $"{video.ThumbnailUrl}.L", $"{video.ThumbnailUrl}.M", $"{video.ThumbnailUrl}", }; await NicoUtil .GetThumbnailAsync(urls) .ContinueWith(x => Thumbnail = x.Result); }
public NicoVideoViewModel(NicoVideoModel x, bool reload = false) : this() { Initialize(x, reload); }