示例#1
0
 public PVContract(PVForSong pv)
     : this((PV)pv)
 {
     Disabled = pv.Disabled;
     Length   = pv.Length;
     ThumbUrl = pv.ThumbUrl;
 }
示例#2
0
 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);
 }
示例#6
0
 public PVContract(PVForSong pv)
     : this((PV)pv)
 {
     ThumbUrl = pv.ThumbUrl;
 }
示例#7
0
 public static string GetThumbUrl(PVForSong pv)
 {
     return(Services[pv.Service].GetThumbUrlById(pv.PVId));
 }
示例#8
0
 public PVContract(PVForSong pv)
     : this((PV)pv)
 {
     Length   = pv.Length;
     ThumbUrl = pv.ThumbUrl;
 }