added check if loaded file is iso
All checks were successful
Java CI / test (push) Successful in 1m38s
All checks were successful
Java CI / test (push) Successful in 1m38s
This commit is contained in:
parent
75fdd45938
commit
4f786226bd
2 changed files with 23 additions and 9 deletions
|
@ -159,18 +159,32 @@ public partial class MainWindow : Window
|
||||||
string[] filesDVDDir = Directory.GetFiles(Path.Combine(settings.library_path.GetValue<string>(), "DVD"));
|
string[] filesDVDDir = Directory.GetFiles(Path.Combine(settings.library_path.GetValue<string>(), "DVD"));
|
||||||
foreach (var file in filesDVDDir)
|
foreach (var file in filesDVDDir)
|
||||||
{
|
{
|
||||||
Game newGame =
|
if (Path.GetExtension(file).ToLower() == ".iso")
|
||||||
new Game(file, true);
|
{
|
||||||
Games.Add(newGame);
|
Game newGame =
|
||||||
Console.Success("Successfully fetched " + 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"));
|
string[] filesCDDir = Directory.GetFiles(Path.Combine(settings.library_path.GetValue<string>(), "CD"));
|
||||||
foreach (var file in filesCDDir)
|
foreach (var file in filesCDDir)
|
||||||
{
|
{
|
||||||
Game newGame =
|
if (Path.GetExtension(file).ToLower() == ".iso")
|
||||||
new Game(file, true);
|
{
|
||||||
Games.Add(newGame);
|
Game newGame =
|
||||||
Console.Success("Successfully fetched " + 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();
|
Games = Games.OrderBy(game => game.Name).ToList();
|
||||||
GamesList.ItemsSource = Games;
|
GamesList.ItemsSource = Games;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||||
<AssemblyVersion>1.0</AssemblyVersion>
|
<AssemblyVersion>1.0</AssemblyVersion>
|
||||||
<FileVersion>1.2</FileVersion>
|
<FileVersion>1.3</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
Loading…
Add table
Reference in a new issue