Browse Source

more linq

pull/109/head
JT 1 year ago
parent
commit
d9e701ce92
  1. 13
      StabilityMatrix.Avalonia/ViewModels/CheckpointManager/CheckpointFile.cs

13
StabilityMatrix.Avalonia/ViewModels/CheckpointManager/CheckpointFile.cs

@ -215,15 +215,10 @@ public partial class CheckpointFile : ViewModelBase
checkpointFile.ConnectedModel = connectedModelInfo; checkpointFile.ConnectedModel = connectedModelInfo;
} }
var possibleImagePaths = SupportedImageExtensions.Select(ext => checkpointFile.PreviewImagePath = SupportedImageExtensions
Path.Combine(directory, .Select(ext => Path.Combine(directory,
$"{Path.GetFileNameWithoutExtension(file)}.preview{ext}")) $"{Path.GetFileNameWithoutExtension(file)}.preview{ext}")).Where(File.Exists)
.Where(File.Exists).ToList(); .FirstOrDefault();
if (possibleImagePaths.Any())
{
checkpointFile.PreviewImagePath = possibleImagePaths.First();
}
yield return checkpointFile; yield return checkpointFile;
} }

Loading…
Cancel
Save