Function front

Source
pub fn front(response: &Json, size: Size) -> Option<Front>
Expand description

Picks the front image out of an index, at the size asked for.

“Front” is decided by the front flag first and by the types list after: both are filled by the archive’s editors, and an image marked in one and not the other is common enough that reading only one leaves records looking as though they have no cover.

An approved image wins over one that is not, when there is a choice. Anyone may upload; approval is an editor having looked. Where nothing is approved the unapproved image is still taken, because a cover somebody uploaded is a better answer than an empty folder.

The size falls back to the original when the thumbnail asked for is not in the answer. The archive generates them for everything it holds today, but a caller that got nothing back because a width was missing would look exactly like a record with no artwork, which is a different thing entirely. Entries without a usable address are skipped before approval is compared.