public static BeatSaberMap ConvertFilesJpgToPng(BeatSaberMap beatSaberMap) { string[] files = Directory.GetFiles(beatSaberMap.ExtractedFilePath, "*.jpg*", SearchOption.AllDirectories); beatSaberMap.InfoData.CoverImageFilename = beatSaberMap.InfoData.CoverImageFilename.Replace(".jpg", ".png"); foreach (string path in files) { string newName = path.Replace(".jpg", ".png"); SafeFileManagement.MoveFile(path, newName); } return(beatSaberMap); }
/// <summary> /// Convert images file to png /// </summary> /// <param name="rootFilePath">Folder that contains .jpg files</param> /// <param name="packInfo">info object that contains data about beatsaber songs</param> /// <returns>updated pack info object</returns> public static Info ConvertImageFiles(string rootFilePath, Info packInfo) { string[] files = Directory.GetFiles(rootFilePath, "*.jpg*", SearchOption.AllDirectories); if (string.IsNullOrEmpty(packInfo.CoverImageFilename)) { return(null); } packInfo.CoverImageFilename = packInfo.CoverImageFilename.Replace(".jpg", ".png"); foreach (string path in files) { string newName = path.Replace(".jpg", ".png"); SafeFileManagement.MoveFile(path, newName); } return(packInfo); }
public static BeatSaberMap ConvertFilesEggToOgg(BeatSaberMap beatSaberMap) { string[] files = Directory.GetFiles(beatSaberMap.ExtractedFilePath, "*.egg*", SearchOption.AllDirectories); string[] alreadyConvertedfiles = Directory.GetFiles(beatSaberMap.ExtractedFilePath, "*.ogg*", SearchOption.AllDirectories); if (files.Length == 0 && alreadyConvertedfiles.Length == 0) { return(beatSaberMap); } beatSaberMap.InfoData.SongFilename = beatSaberMap.InfoData.SongFilename.Replace(".egg", ".ogg"); foreach (string path in files) { string newName = path.Replace(".egg", ".ogg"); SafeFileManagement.MoveFile(path, newName); } return(beatSaberMap); }
/// <summary> /// Convert egg file to ogg /// </summary> /// <param name="rootFilePath">Folder that contains .egg files</param> /// <param name="info">Info object that contains data about beatsaber songs</param> /// <returns>Updated pack info object</returns> public static Info ConvertSoundFile(string rootFilePath, Info info) { string[] files = Directory.GetFiles(rootFilePath, "*.egg*", SearchOption.AllDirectories); string[] alreadyConvertedfiles = Directory.GetFiles(rootFilePath, "*.ogg*", SearchOption.AllDirectories); if (string.IsNullOrEmpty(info.SongFilename)) { return(null); } info.SongFilename = info.SongFilename.Replace(".egg", ".ogg"); if (files.Length == 0 && alreadyConvertedfiles.Length == 0) { return(null); } foreach (string path in files) { string newName = path.Replace(".egg", ".ogg"); SafeFileManagement.MoveFile(path, newName); } return(info); }