added check if loaded file is iso
All checks were successful
Java CI / test (push) Successful in 1m38s

This commit is contained in:
WeeXnes 2025-05-03 23:17:52 +02:00
parent 75fdd45938
commit 4f786226bd
2 changed files with 23 additions and 9 deletions

View file

@ -159,19 +159,33 @@ public partial class MainWindow : Window
string[] filesDVDDir = Directory.GetFiles(Path.Combine(settings.library_path.GetValue<string>(), "DVD"));
foreach (var file in filesDVDDir)
{
Game newGame =
new Game(file, true);
Games.Add(newGame);
Console.Success("Successfully fetched " + newGame);
}
string[] filesCDDir = Directory.GetFiles(Path.Combine(settings.library_path.GetValue<string>(), "CD"));
foreach (var file in filesCDDir)
if (Path.GetExtension(file).ToLower() == ".iso")
{
Game newGame =
new Game(file, true);
Games.Add(newGame);
Console.Success("Successfully fetched " + newGame);
}
else
{
Console.WriteLine("Skipped non-ISO file: " + file);
}
}
string[] filesCDDir = Directory.GetFiles(Path.Combine(settings.library_path.GetValue<string>(), "CD"));
foreach (var file in filesCDDir)
{
if (Path.GetExtension(file).ToLower() == ".iso")
{
Game newGame =
new Game(file, true);
Games.Add(newGame);
Console.Success("Successfully fetched " + newGame);
}
else
{
Console.WriteLine("Skipped non-ISO file: " + file);
}
}
Games = Games.OrderBy(game => game.Name).ToList();
GamesList.ItemsSource = Games;
FetchVMCs();

View file

@ -8,7 +8,7 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<AssemblyVersion>1.0</AssemblyVersion>
<FileVersion>1.2</FileVersion>
<FileVersion>1.3</FileVersion>
</PropertyGroup>
<ItemGroup>