diff --git a/DiscImageChef.Filters/BZip2.cs b/DiscImageChef.Filters/BZip2.cs index 1bdcade7..2afc32a5 100644 --- a/DiscImageChef.Filters/BZip2.cs +++ b/DiscImageChef.Filters/BZip2.cs @@ -221,7 +221,13 @@ namespace DiscImageChef.Filters public override string GetFilename() { - return basePath != null ? Path.GetFileName(basePath) : null; + if(basePath == null) + return null; + if(basePath.EndsWith(".bz2", StringComparison.InvariantCultureIgnoreCase)) + return basePath.Substring(0, basePath.Length - 4); + if(basePath.EndsWith(".bzip2", StringComparison.InvariantCultureIgnoreCase)) + return basePath.Substring(0, basePath.Length - 6); + return basePath; } public override string GetParentFolder() diff --git a/DiscImageChef.Filters/GZip.cs b/DiscImageChef.Filters/GZip.cs index bd778d30..2c22e700 100644 --- a/DiscImageChef.Filters/GZip.cs +++ b/DiscImageChef.Filters/GZip.cs @@ -225,7 +225,13 @@ namespace DiscImageChef.Filters public override string GetFilename() { - return basePath != null ? Path.GetFileName(basePath) : null; + if(basePath == null) + return null; + if(basePath.EndsWith(".gz", StringComparison.InvariantCultureIgnoreCase)) + return basePath.Substring(0, basePath.Length - 3); + if(basePath.EndsWith(".gzip", StringComparison.InvariantCultureIgnoreCase)) + return basePath.Substring(0, basePath.Length - 5); + return basePath; } public override string GetParentFolder() diff --git a/DiscImageChef.Filters/LZip.cs b/DiscImageChef.Filters/LZip.cs index c87a9948..f0b58e56 100644 --- a/DiscImageChef.Filters/LZip.cs +++ b/DiscImageChef.Filters/LZip.cs @@ -193,7 +193,13 @@ namespace DiscImageChef.Filters public override string GetFilename() { - return basePath != null ? Path.GetFileName(basePath) : null; + if(basePath == null) + return null; + if(basePath.EndsWith(".lz", StringComparison.InvariantCultureIgnoreCase)) + return basePath.Substring(0, basePath.Length - 3); + if(basePath.EndsWith(".lzip", StringComparison.InvariantCultureIgnoreCase)) + return basePath.Substring(0, basePath.Length - 5); + return basePath; } public override string GetParentFolder() diff --git a/DiscImageChef.Filters/XZ.cs b/DiscImageChef.Filters/XZ.cs index 15ba8e67..4889480f 100644 --- a/DiscImageChef.Filters/XZ.cs +++ b/DiscImageChef.Filters/XZ.cs @@ -240,7 +240,13 @@ namespace DiscImageChef.Filters public override string GetFilename() { - return basePath != null ? Path.GetFileName(basePath) : null; + if(basePath == null) + return null; + if(basePath.EndsWith(".xz", StringComparison.InvariantCultureIgnoreCase)) + return basePath.Substring(0, basePath.Length - 3); + if(basePath.EndsWith(".xzip", StringComparison.InvariantCultureIgnoreCase)) + return basePath.Substring(0, basePath.Length - 5); + return basePath; } public override string GetParentFolder()