示例#1
0
		public VideoPublishSummary(FinishedVideo fv)
		{
			Guid = fv.Guid;
			Name = fv.Name;
			Duration = fv.Duration;
							
		}
示例#2
0
 public VideoWrap(FinishedVideo data)
 {
     Video = data;
 }
示例#3
0
        public void Save()
        {
            Publish.Commit();
            EditorModelIO.Save(GlobalData);
            if (GlobalData.RelativeVideoListPath!=null)
            {
                var file = new FileInfo(Path.Combine(
                    GlobalData.GlobalDataFolder.FullName,
                    GlobalData.RelativeVideoListPath,
                    Tuto.Model.GlobalData.VideoListName));
                List<VideoPublishSummary> currentList = new List<VideoPublishSummary>();
                if (file.Exists)
                    currentList = HeadedJsonFormat.Read<List<VideoPublishSummary>>(file);

                foreach (var e in models)
                    for (int i = 0; i < e.Montage.Information.Episodes.Count; i++)
                    {
                        var alreadySaved = currentList.Where(z => z.Guid == e.Montage.Information.Episodes[i].Guid).FirstOrDefault();
                        if (alreadySaved != null) currentList.Remove(alreadySaved);
                        var fv = new FinishedVideo(e, i);
                        var pv = new VideoPublishSummary { Guid = fv.Guid, Name = fv.Name, Duration = fv.Duration };
                        pv.OrdinalSuffix = fv.RelativeSourceFolderLocation + "-" + fv.EpisodeNumber;
                        currentList.Add(pv);
                    }

                HeadedJsonFormat.Write(file, currentList);
            }
        }