Skip to content

Commit

Permalink
Unique names will also check comma separated values.
Browse files Browse the repository at this point in the history
  • Loading branch information
maforget committed May 28, 2024
1 parent ff6a42f commit 1be6b7c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
30 changes: 19 additions & 11 deletions ComicRack.Engine/ComicBook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1062,12 +1062,12 @@ public string ArtistInfo
{
HashSet<string> uniqueNames = new HashSet<string>();
StringBuilder stringBuilder = new StringBuilder();
AppendUniqueArtist(stringBuilder, "/", base.Writer, uniqueNames);
AppendUniqueArtist(stringBuilder, "/", base.Penciller, uniqueNames);
AppendUniqueArtist(stringBuilder, "/", base.Inker, uniqueNames);
AppendUniqueArtist(stringBuilder, "/", base.Colorist, uniqueNames);
AppendUniqueArtist(stringBuilder, "/", base.Letterer, uniqueNames);
AppendUniqueArtist(stringBuilder, "/", base.CoverArtist, uniqueNames);
AppendUniqueName(stringBuilder, "/", base.Writer, uniqueNames);
AppendUniqueName(stringBuilder, "/", base.Penciller, uniqueNames);
AppendUniqueName(stringBuilder, "/", base.Inker, uniqueNames);
AppendUniqueName(stringBuilder, "/", base.Colorist, uniqueNames);
AppendUniqueName(stringBuilder, "/", base.Letterer, uniqueNames);
AppendUniqueName(stringBuilder, "/", base.CoverArtist, uniqueNames);

return stringBuilder.ToString();
}
Expand Down Expand Up @@ -2651,15 +2651,23 @@ public static string FormatTitle(string textFormat, string series, string title
return fileName ?? string.Empty;
}

private static void AppendUniqueArtist(StringBuilder s, string delimiter, string text, HashSet<string> uniqueNames)
private static void AppendUniqueName(StringBuilder s, string delimiter, string text, HashSet<string> uniqueNames)
{
if (!string.IsNullOrEmpty(text) && uniqueNames.Add(text))
if (!string.IsNullOrEmpty(text))
{
if (s.Length != 0)
var names = text.Split(',', StringSplitOptions.RemoveEmptyEntries);
foreach (var name in names)
{
s.Append(delimiter);
var trimmedName = name.Trim();
if (!string.IsNullOrEmpty(trimmedName) && uniqueNames.Add(trimmedName))
{
if (s.Length != 0)
{
s.Append(delimiter);
}
s.Append(trimmedName);
}
}
s.Append(text);
}
}

Expand Down
1 change: 1 addition & 0 deletions ComicRack/Changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Community Edition Build 0.9.180:
* CHANGE: Updated Publishers.zip
* CHANGE: Series: Gaps will try to determine Number range of type "# - #".
* CHANGE: The default method for resizing thumbnails was changed from FastBilinear (Bilinear) to FastAndUgly (Nearest Neighbor). For more speed but more importantly to prevent a crash that has been happening and is hard to prevent. This should at the very least reduce the incidence of that crash happening or having bad thumnails created (with a big red X). You can change back the method manually by changing the ThumbnailResampling entry in the ComicRack.ini.
* CHANGE: When in the Tiles view mode, artists will not appear multiple time anymore.

* BUGFIX: Fixed crash when the clipboard contains some objects while the program is idle. The check should now only happen on a right-click and not in the background. It should at least lessen the frequency of the crash, maybe remove it completely.
* BUGFIX: Fixed smartlist "in range" for dates, the second field wasn't taken into account.
Expand Down

0 comments on commit 1be6b7c

Please sign in to comment.