mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Add deleteable file lists for Redumper and DIC
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
- Fix drive letter check
|
||||
- Simply theme application
|
||||
- Add framework for deleteable files
|
||||
- Add deleteable file lists for Redumper and DIC
|
||||
|
||||
### 2.7.2 (2023-10-17)
|
||||
|
||||
|
||||
@@ -1851,6 +1851,56 @@ namespace MPF.Core.Modules.DiscImageCreator
|
||||
public override string? GetDefaultExtension(MediaType? mediaType) => Converters.Extension(mediaType);
|
||||
#endif
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override List<string> GetDeleteableFilePaths(string basePath)
|
||||
{
|
||||
var deleteableFiles = new List<string>();
|
||||
switch (this.Type)
|
||||
{
|
||||
case MediaType.CDROM:
|
||||
case MediaType.GDROM:
|
||||
if (File.Exists($"{basePath}.img"))
|
||||
deleteableFiles.Add($"{basePath}.img");
|
||||
if (File.Exists($"{basePath} (Track 0).img"))
|
||||
deleteableFiles.Add($"{basePath} (Track 0).img");
|
||||
if (File.Exists($"{basePath} (Track 00).img"))
|
||||
deleteableFiles.Add($"{basePath} (Track 00).img");
|
||||
if (File.Exists($"{basePath} (Track 1)(-LBA).img"))
|
||||
deleteableFiles.Add($"{basePath} (Track 1)(-LBA).img");
|
||||
if (File.Exists($"{basePath} (Track 01)(-LBA).img"))
|
||||
deleteableFiles.Add($"{basePath} (Track 01)(-LBA).img");
|
||||
if (File.Exists($"{basePath} (Track AA).img")
|
||||
deleteableFiles.Add($"{basePath} (Track AA).img");
|
||||
|
||||
if (File.Exists($"{basePath}.scm"))
|
||||
deleteableFiles.Add($"{basePath}.scm");
|
||||
if (File.Exists($"{basePath} (Track 0).scm"))
|
||||
deleteableFiles.Add($"{basePath} (Track 0).scm");
|
||||
if (File.Exists($"{basePath} (Track 00).scm"))
|
||||
deleteableFiles.Add($"{basePath} (Track 00).scm");
|
||||
if (File.Exists($"{basePath} (Track 1)(-LBA).scm"))
|
||||
deleteableFiles.Add($"{basePath} (Track 1)(-LBA).scm");
|
||||
if (File.Exists($"{basePath} (Track 01)(-LBA).scm"))
|
||||
deleteableFiles.Add($"{basePath} (Track 01)(-LBA).scm");
|
||||
if (File.Exists($"{basePath} (Track AA).scm"))
|
||||
deleteableFiles.Add($"{basePath} (Track AA).scm");
|
||||
|
||||
break;
|
||||
|
||||
case MediaType.DVD:
|
||||
case MediaType.HDDVD:
|
||||
case MediaType.BluRay:
|
||||
case MediaType.NintendoGameCubeGameDisc:
|
||||
case MediaType.NintendoWiiOpticalDisc:
|
||||
if (File.Exists($"{basePath}.raw"))
|
||||
deleteableFiles.Add($"{basePath}.raw");
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return deleteableFiles;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override List<string> GetLogFilePaths(string basePath)
|
||||
{
|
||||
|
||||
@@ -932,6 +932,19 @@ namespace MPF.Core.Modules.Redumper
|
||||
public override string? GetDefaultExtension(MediaType? mediaType) => Converters.Extension(mediaType);
|
||||
#endif
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override List<string> GetDeleteableFilePaths(string basePath)
|
||||
{
|
||||
var deleteableFiles = new List<string>();
|
||||
|
||||
if (File.Exists($"{basePath}.scram"))
|
||||
deleteableFiles.Add($"{basePath}.scram");
|
||||
if (File.Exists($"{basePath}.scrap"))
|
||||
deleteableFiles.Add($"{basePath}.scrap");
|
||||
|
||||
return deleteableFiles;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override List<string> GetLogFilePaths(string basePath)
|
||||
{
|
||||
@@ -946,10 +959,6 @@ namespace MPF.Core.Modules.Redumper
|
||||
logFiles.Add($"{basePath}.fulltoc");
|
||||
if (File.Exists($"{basePath}.log"))
|
||||
logFiles.Add($"{basePath}.log");
|
||||
// if (File.Exists($"{basePath}.scram"))
|
||||
// logFiles.Add($"{basePath}.scram");
|
||||
// if (File.Exists($"{basePath}.scrap"))
|
||||
// logFiles.Add($"{basePath}.scrap");
|
||||
if (File.Exists($"{basePath}.state"))
|
||||
logFiles.Add($"{basePath}.state");
|
||||
if (File.Exists($"{basePath}.subcode"))
|
||||
|
||||
Reference in New Issue
Block a user