From 8a4a9e5bd41c3a9f14917f8dadf641372a821a82 Mon Sep 17 00:00:00 2001 From: tmokmss Date: Sun, 27 May 2018 03:12:34 +0900 Subject: [PATCH] exclude beatmaps other than osu! (such as taiko, CtB, or mania) --- Osu2Saber/Model/BatchProcessor.cs | 5 +++-- Osu2Saber/Model/OszProcessor.cs | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Osu2Saber/Model/BatchProcessor.cs b/Osu2Saber/Model/BatchProcessor.cs index dcdbb4b..fb49a1b 100644 --- a/Osu2Saber/Model/BatchProcessor.cs +++ b/Osu2Saber/Model/BatchProcessor.cs @@ -57,11 +57,12 @@ OszProcessor DecompressOsz(int index) { OszProcessor.WorkDir = WorkDir; var oszPath = TargetFiles[index]; - var oszp = new OszProcessor(oszPath); if (!oszPath.EndsWith("osz") && !oszPath.EndsWith("zip")) return null; - var files = oszp.OsuFiles; + var oszp = new OszProcessor(oszPath); + if (oszp.OsuFiles.Length == 0) return null; + ReportProgress(0.3); return oszp; } diff --git a/Osu2Saber/Model/OszProcessor.cs b/Osu2Saber/Model/OszProcessor.cs index 1fb31fd..b68bf39 100644 --- a/Osu2Saber/Model/OszProcessor.cs +++ b/Osu2Saber/Model/OszProcessor.cs @@ -77,7 +77,10 @@ public Beatmap LoadOsuFile(int index) public Beatmap[] LoadOsuFiles() { var beatmaps = OsuFiles - .Select((e, i) => LoadOsuFile(i)).Where(map => map != null).ToArray(); + .Select((e, i) => LoadOsuFile(i)) + .Where(map => map != null) + .Where(map => map.Mode == 0) // pick osu! maps only (not taiko, CtB, or mania) + .ToArray(); return beatmaps; }