Skip to content

Commit 93017d4

Browse files
committed
Ignore image in __MACOSX & .DS_Store folders inside archive.
1 parent 77f7431 commit 93017d4

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

ComicRack.Engine/IO/Provider/Readers/ComicProvider.cs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,18 @@ protected virtual bool OnStoreInfo(ComicInfo comicInfo)
8787
}
8888

8989
protected virtual bool IsSupportedImage(string file)
90-
{
91-
string fileExt = Path.GetExtension(FileUtility.MakeValidFilename(file));
92-
return supportedTypes.Any((string ext) => string.Equals(fileExt, "." + ext, StringComparison.OrdinalIgnoreCase));
93-
}
94-
}
90+
{
91+
if(ShouldIgnoreFile(file))
92+
return false;
93+
94+
string fileExt = Path.GetExtension(FileUtility.MakeValidFilename(file));
95+
return supportedTypes.Any((string ext) => string.Equals(fileExt, "." + ext, StringComparison.OrdinalIgnoreCase));
96+
}
97+
98+
private static bool ShouldIgnoreFile(string file)
99+
{
100+
string[] ignore = { ".DS_Store\\", "__MACOSX\\" };
101+
return ignore.Any(item => file.Contains(item));
102+
}
103+
}
95104
}

ComicRack/Changes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Community Edition Build 0.9.180:
1414
* NEW: Quick Search (using Mode All) will now search Scan Information & Custom Fields.
1515
* NEW: Added the Web field to smart list, so no more need to use expressions. (Again backup your DB, this could result in a corrupted database if going back to an older version)
1616
* NEW: Added an "Is Missing" smart list entry. (Again backup your DB, this could result in a corrupted database if going back to an older version)
17+
* NEW: "__MACOSX" & ".DS_Store" folders will be ignored inside archives.
1718

1819
* CHANGE: Updated to .NET Framework v4.8.
1920
* CHANGE: Updated the Splash Screen and Renamed the Program to Community Edition, this means that a new config folder will be used %appdata%\cYo\ComicRack Community Edition.

0 commit comments

Comments
 (0)