1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-31 17:52:54 +08:00

Catch and display user-friendly errors regarding corrupted audio files

Addresses lack of user feedback as indicated by
https://github.com/ppy/osu/issues/31693.
This commit is contained in:
Bartłomiej Dach 2025-01-27 10:25:22 +01:00
parent 129ab03ec4
commit 01ae1a58f1
No known key found for this signature in database

View File

@ -8,6 +8,7 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Framework.Logging;
using osu.Game.Beatmaps;
using osu.Game.Overlays;
using osu.Game.Localisation;
@ -97,7 +98,17 @@ namespace osu.Game.Screens.Edit.Setup
if (!source.Exists)
return false;
var tagSource = TagLib.File.Create(source.FullName);
TagLib.File? tagSource;
try
{
tagSource = TagLib.File.Create(source.FullName);
}
catch (Exception e)
{
Logger.Error(e, "The selected audio track appears to be corrupted. Please select another one.");
return false;
}
changeResource(source, applyToAllDifficulties, @"audio",
metadata => metadata.AudioFile,