public VideoPublishSummary(FinishedVideo fv) { Guid = fv.Guid; Name = fv.Name; Duration = fv.Duration; }
public VideoWrap(FinishedVideo data) { Video = data; }
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); } }