Filename should not include compressed extension.

This commit is contained in:
2017-07-01 03:26:31 +01:00
parent dbe5a51222
commit ec94c6e913
4 changed files with 28 additions and 4 deletions

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()