Skip to content

Commit

Permalink
exclude beatmaps other than osu! (such as taiko, CtB, or mania)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmokmss committed May 26, 2018
1 parent b3ab64f commit 8a4a9e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Osu2Saber/Model/BatchProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 4 additions & 1 deletion Osu2Saber/Model/OszProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 8a4a9e5

Please sign in to comment.