Skip to content

Commit 29cbe43

Browse files
hattonclaude
andcommitted
@
Rename doNotPaste->nonCreditable in image-credit filtering Per review: the "paste" terminology was misleading—this list has nothing to do with pasting credits; it is the set of images we never generate/show credits for (license, placeholder, branding). Rename GetImageFilesToNotPasteCreditsFor->GetImageFilesToNotCreditFor and the local doNotPaste->nonCreditableImages, and fix the comment accordingly. No behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> @
1 parent 6a91792 commit 29cbe43

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/BloomExe/web/controllers/ImageApi.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ public class ImageApi
2828
public ImageApi(BookSelection bookSelection)
2929
{
3030
_bookSelection = bookSelection;
31-
// The following is a list of image files that we don't want to paste image credits for.
31+
// The following is a list of image files that we don't want to generate image credits for.
3232
// It includes CC license image, placeholder and branding images.
33-
_doNotPasteArray = GetImageFilesToNotPasteCreditsFor().ToArray();
33+
_doNotPasteArray = GetImageFilesToNotCreditFor().ToArray();
3434
for (int i = 0; i < _doNotPasteArray.Length; ++i)
3535
_doNotPasteArray[i] = BookStorage.GetNormalizedPathForOS(_doNotPasteArray[i]);
3636
}
3737

38-
private static IEnumerable<string> GetImageFilesToNotPasteCreditsFor()
38+
private static IEnumerable<string> GetImageFilesToNotCreditFor()
3939
{
4040
// Handles all except placeholder images. They can show up with digits after them, so we do them differently.
4141
var imageFiles = new HashSet<string> { "license.png" };
@@ -103,12 +103,12 @@ public static List<string> GetCreditableImageFileNamesInBook(
103103
IEnumerable<string> langs
104104
)
105105
{
106-
var doNotPaste = new HashSet<string>(
107-
GetImageFilesToNotPasteCreditsFor().Select(BookStorage.GetNormalizedPathForOS)
106+
var nonCreditableImages = new HashSet<string>(
107+
GetImageFilesToNotCreditFor().Select(BookStorage.GetNormalizedPathForOS)
108108
);
109109
return GetWhichImagesAreUsedOnWhichPages(domBody, langs)
110110
.Keys.Where(name =>
111-
!doNotPaste.Contains(BookStorage.GetNormalizedPathForOS(name))
111+
!nonCreditableImages.Contains(BookStorage.GetNormalizedPathForOS(name))
112112
&& !name.ToLowerInvariant().StartsWith("placeholder")
113113
)
114114
.ToList();

0 commit comments

Comments
 (0)