Spaces:
Running

MiniSearch / shared /imageIdentity.ts
system's picture
system HF Staff
Sync from felladrin/MiniSearch@9686d62 (part 2)
e0d0231 verified
Raw History Blame Contribute Delete
505 Bytes
/**
* What makes an image or video result distinct: its full-size source, then its
* thumbnail, then its page. The page alone is not enough, since one gallery page
* holds many different images. The server, the screen and the history all
* identify image results through this, so they agree on what counts as one.
*/
export function getImageIdentity(
sourceUrl: string | undefined,
thumbnailUrl: string | undefined,
pageUrl: string,
): string {
return sourceUrl || thumbnailUrl || pageUrl;
}