internal void ExportFilesTo(string contentLoc) { string newWorkArea = contentLoc + "\\" + title; DiskIO.CreateDirectory(newWorkArea); DiskIO.SaveAsJSONFile(this, newWorkArea, "index.en.json"); }
internal FileCopier[] ExportFilesTo(string contentLoc, string[] _languages) { string newWorkArea = contentLoc + "\\" + title; List <FileCopier> allFilesToCopy = new List <FileCopier>(); // create root folder DiskIO.CreateDirectory(newWorkArea); DiskIO.DeleteAllFiles(newWorkArea); foreach (MovieFile p in this.library) { // create each movie folder string movieNewLocation = newWorkArea + "\\" + p.id; DiskIO.CreateDirectory(movieNewLocation); // add video files to copy allFilesToCopy.Add(new FileCopier(p.video.path, movieNewLocation + "\\" + DiskIO.GetFileName(p.video.path))); // change the file path to the new path for further library json saving p.video.path = DiskIO.GetFileName(p.video.path); // add trailer if exist if (!string.IsNullOrEmpty(p.trailer.path)) { allFilesToCopy.Add(new FileCopier(p.trailer.path, movieNewLocation + "\\" + DiskIO.GetFileName(p.trailer.path))); p.trailer.path = DiskIO.GetFileName(p.trailer.path); } if (!string.IsNullOrEmpty(p.cover)) { // add video cover to copy allFilesToCopy.Add(new FileCopier(p.cover, movieNewLocation + "\\cover.jpg")); // change the cover path to the new path for further library json saving p.cover = "\\cover.jpg"; } } // save changed paths and music files into exported location this.SaveMovieLibraryAtLocation(newWorkArea, "index.en.json"); // copy all requested non-English langs foreach (string lang in _languages) { string abbriv = "index." + lang.Substring(0, 2).ToLower() + ".json"; if (DiskIO.IsFileExist(ContentLocation, abbriv)) { VideoFolder temp = DiskIO.DeserializeVideoFolderFromFile(ContentLocation, abbriv); foreach (MovieFile p in temp.library) { p.video.path = "\\" + DiskIO.GetFileName(p.video.path); if (!string.IsNullOrEmpty(p.trailer.path)) { p.trailer.path = "\\" + DiskIO.GetFileName(p.trailer.path); } if (!string.IsNullOrEmpty(p.cover)) { p.cover = "\\cover.jpg"; } } DiskIO.SaveAsJSONFile(temp, newWorkArea, abbriv); } } return(allFilesToCopy.ToArray()); }
internal void SavePlaylistLibrary() { // save all playlists json file DiskIO.SaveAsJSONFile(this, this.ContentLocation, "index.en.json"); // create folder for each playlist and save their music tracks foreach (MusicPlaylist pls in this.library) { string playlistFolder = this.ContentLocation + "\\" + pls.id; DiskIO.CreateDirectory(playlistFolder); pls.SaveMusicFilesInfos(playlistFolder, "index.Json"); } }
internal FileCopier[] ExportFilesTo(string _contentLoc, string[] _languages) { string newWorkArea = _contentLoc + "\\" + title; List <FileCopier> allFilesToCopy = new List <FileCopier>(); // create root folder DiskIO.CreateDirectory(newWorkArea); DiskIO.DeleteAllFiles(newWorkArea); // create each playlist folder foreach (MusicPlaylist p in this.library) { string playlistNewLocation = newWorkArea + "\\" + p.id; DiskIO.CreateDirectory(playlistNewLocation); // determine music files to copy foreach (MusicFile file in p.GetMusicFilesInfo()) { // add music file allFilesToCopy.Add(new FileCopier(file.file, playlistNewLocation + "\\" + DiskIO.GetFileName(file.file))); // change the file path to the new path for further library json saving file.file = DiskIO.GetFileName(file.file); } // add playlist cover to copy if (p.cover != "") { allFilesToCopy.Add(new FileCopier(p.cover, playlistNewLocation + "\\cover.jpg")); // change the cover path to the new path for further library json saving p.cover = "\\cover.jpg"; } p.playlist = "\\index.m3u"; } // save changed paths and music files into exported location this.SavePlaylistLibraryAtLocation(newWorkArea, "index.en.json"); // copy all requested non-English langs foreach (string lang in _languages) { string abbriv = "index." + lang.Substring(0, 2).ToLower() + ".json"; if (DiskIO.IsFileExist(ContentLocation, abbriv)) { AudioFolder temp = DiskIO.DeserializeAudioFolderFromFile(ContentLocation, abbriv); foreach (MusicPlaylist x in temp.library) { x.playlist = "\\index.m3u"; if (x.cover != "") { x.cover = "\\cover.jpg"; } } DiskIO.SaveAsJSONFile(temp, newWorkArea, abbriv); } } return(allFilesToCopy.ToArray()); }
public void CreateNewProjectDirectories() { //create projet itslef files and folders DiskIO.CreateDirectory(location, title); DiskIO.CreateDirectory(ContentLocation); this.CreateNewProjetFiles(); //create subfolders for contents playlists.CreateNewAudioDirectory(); movies.CreateNewVideoDirectory(); articles.CreateNewPDFDirectory(); announces.CreateNewVideoDirectory(); questions.CreateNewSurveyDirectory(); }
internal FileCopier[] ExportTo(string _selectedExportPath, string[] _languages) { List <FileCopier> allFilesToCopy = new List <FileCopier>(); DiskIO.CreateDirectory(_selectedExportPath + "\\output"); DiskIO.CreateDirectory(_selectedExportPath + "\\output" + "\\files"); string contentLoc = _selectedExportPath + "\\output" + "\\files"; allFilesToCopy.AddRange(this.playlists.ExportFilesTo(contentLoc, _languages)); allFilesToCopy.AddRange(this.movies.ExportFilesTo(contentLoc, _languages)); allFilesToCopy.AddRange(this.announces.ExportFilesTo(contentLoc, _languages)); allFilesToCopy.AddRange(this.articles.ExportFilesTo(contentLoc, _languages)); this.questions.ExportFilesTo(contentLoc); return(allFilesToCopy.ToArray()); }
internal void CreateNewSurveyDirectory() { DiskIO.CreateDirectory(location, title); //DiskIO.DeleteFile(ContentLocation, "index.en.json"); }
public void CreateNewVideoDirectory() { DiskIO.CreateDirectory(location, title); DiskIO.DeleteFile(ContentLocation, "index.en.json"); }