mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 16:43:52 +09:00
Only check each video file once
This commit is contained in:
@ -24,6 +24,7 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
public IEnumerable<Issue> Run(BeatmapVerifierContext context)
|
public IEnumerable<Issue> Run(BeatmapVerifierContext context)
|
||||||
{
|
{
|
||||||
var beatmapSet = context.Beatmap.BeatmapInfo.BeatmapSet;
|
var beatmapSet = context.Beatmap.BeatmapInfo.BeatmapSet;
|
||||||
|
var videoPaths = new List<string>();
|
||||||
|
|
||||||
foreach (var layer in context.WorkingBeatmap.Storyboard.Layers)
|
foreach (var layer in context.WorkingBeatmap.Storyboard.Layers)
|
||||||
{
|
{
|
||||||
@ -32,7 +33,14 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
if (!(element is StoryboardVideo video))
|
if (!(element is StoryboardVideo video))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
string filename = video.Path;
|
// Ensures we don't check the same video file multiple times in case of multiple elements using it.
|
||||||
|
if (!videoPaths.Contains(video.Path))
|
||||||
|
videoPaths.Add(video.Path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var filename in videoPaths)
|
||||||
|
{
|
||||||
string storagePath = beatmapSet.GetPathForFile(filename);
|
string storagePath = beatmapSet.GetPathForFile(filename);
|
||||||
|
|
||||||
if (storagePath == null)
|
if (storagePath == null)
|
||||||
@ -52,7 +60,6 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
yield return new IssueTemplateHasAudioTrack(this).Create(filename);
|
yield return new IssueTemplateHasAudioTrack(this).Create(filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public class IssueTemplateHasAudioTrack : IssueTemplate
|
public class IssueTemplateHasAudioTrack : IssueTemplate
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user