public static string GetImageLocation(this Beatmap beatmap) { if (beatmap.GetType().IsAssignableFrom(typeof(BeatmapExtension))) { if (((BeatmapExtension)beatmap).LocalBeatmapMissing) { return(string.Empty); } } var osuFileLocation = beatmap.FullOsuFileLocation(); string ImageLocation = string.Empty; using (StreamReader file = new StreamReader(osuFileLocation)) { string line; while ((line = file.ReadLine()) != null) { if (line.ToLower().Contains(".jpg") || line.ToLower().Contains(".png")) { var splited = line.Split(','); ImageLocation = Path.Combine(beatmap.BeatmapDirectory(), splited[2].Trim('"')); if (!File.Exists(ImageLocation)) { return(string.Empty); } break; } } } return(ImageLocation); }
public static string FullOsuFileLocation(this Beatmap beatmap, string songsDirectory) { var beatmapDirectory = beatmap.BeatmapDirectory(songsDirectory); if (string.IsNullOrEmpty(beatmapDirectory) || string.IsNullOrEmpty(beatmap.OsuFileName)) { return(""); } return(Path.Combine(beatmapDirectory, beatmap.OsuFileName)); }
public static string FullAudioFileLocation(this Beatmap beatmap) { var isSubclassed = beatmap.GetType().IsAssignableFrom(typeof(BeatmapExtension)); if (isSubclassed) { if (((BeatmapExtension)beatmap).LocalBeatmapMissing) { return(string.Empty); } } return(Path.Combine(beatmap.BeatmapDirectory(), beatmap.Mp3Name)); }
public static string FullOsuFileLocation(this Beatmap beatmap) { return(Path.Combine(beatmap.BeatmapDirectory(), beatmap.OsuFileName)); }