ignore missing files
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -41,6 +42,12 @@ namespace AssetStudioGUI
|
|||||||
private async void loadSelected_Click(object sender, EventArgs e)
|
private async void loadSelected_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var files = assetListView.SelectedRows.Cast<DataGridViewRow>().Select(x => x.DataBoundItem as AssetEntry).Select(x => x.Source).ToHashSet();
|
var files = assetListView.SelectedRows.Cast<DataGridViewRow>().Select(x => x.DataBoundItem as AssetEntry).Select(x => x.Source).ToHashSet();
|
||||||
|
var missingFiles = files.Where(x => !File.Exists(x));
|
||||||
|
foreach (var file in missingFiles)
|
||||||
|
{
|
||||||
|
Logger.Warning($"Unable to find file {file}, skipping...");
|
||||||
|
files.Remove(file);
|
||||||
|
}
|
||||||
if (files.Count != 0 && !files.Any(string.IsNullOrEmpty))
|
if (files.Count != 0 && !files.Any(string.IsNullOrEmpty))
|
||||||
{
|
{
|
||||||
Logger.Info("Loading...");
|
Logger.Info("Loading...");
|
||||||
|
|||||||
Reference in New Issue
Block a user