public PVContract(PVForSong pv) : this((PV)pv) { Disabled = pv.Disabled; Length = pv.Length; ThumbUrl = pv.ThumbUrl; }
public ArchivedPVContract(PVForSong pv) : this((PV)pv) { Length = pv.Length; PublishDate = pv.PublishDate; ThumbUrl = pv.ThumbUrl; }
public void SetUp() { originalWithThumb = new PVForSong { Service = PVService.NicoNicoDouga, PVType = PVType.Original, PVId = "original_id", ThumbUrl = "original" }; reprintWithThumb = new PVForSong { Service = PVService.Youtube, PVType = PVType.Reprint, PVId = "reprint_id", ThumbUrl = "reprint" }; }
private void CreateThumbnail(string oldFull, string pvId, PVForSong pv) { if (!IsImage(oldFull)) { return; } var path = Path.Combine(AppConfig.StaticContentPath + "\\media-thumb\\", pvId); using (var stream = new FileStream(oldFull, FileMode.Open)) using (var original = ImageHelper.OpenImage(stream)) { var thumb = ImageHelper.ResizeToFixedSize(original, 560, 315); thumb.Save(path); pv.ThumbUrl = VocaUriBuilder.StaticResource("/media-thumb/" + pvId); pv.Song.UpdateThumbUrl(); } }
public PVForSongContract(PVForSong pv, ContentLanguagePreference languagePreference) : base(pv) { Song = new SongContract(pv.Song, languagePreference); }
public PVContract(PVForSong pv) : this((PV)pv) { ThumbUrl = pv.ThumbUrl; }
public static string GetThumbUrl(PVForSong pv) { return(Services[pv.Service].GetThumbUrlById(pv.PVId)); }
public PVContract(PVForSong pv) : this((PV)pv) { Length = pv.Length; ThumbUrl = pv.ThumbUrl; }