add tags to anime cards, use fallback for title if no subtype is provided/available

This commit is contained in:
bignutty 2025-02-22 16:10:34 +01:00
parent 2bb389ad93
commit e4c0934d8e
3 changed files with 13 additions and 4 deletions

View file

@ -33,8 +33,12 @@ function renderAnimeResultsPage(context, res, includeSupplementalData = true){
// Render Description
if(res.subtitle) result.description += `-# ${res.subtitle}\n\n`;
if(res.type !== "ANIME") result.description += pill(OMNI_ANIME_FORMAT_TYPES[res.type]) + " "
if(res.subtype) result.description += pill(OMNI_ANIME_FORMAT_TYPES[res.subtype]) + " "
if(res.genres) result.description += res.genres.map((r)=>smallPill(r)).join(" ") + "\n\n";
else {
if(res.subtype) result.description += pill(OMNI_ANIME_FORMAT_TYPES[res.subtype]) + " "
else result.description += pill(OMNI_ANIME_FORMAT_TYPES[res.type]) + " "
}
if(res.genres) result.description += res.genres.map((r)=>smallPill(r)).join(" ") + "\n";
if(res.tags) result.description += "-# " + res.tags.map((t)=>smallPill(t)).join(" ") + "\n\n";
if(res.description) result.description += stringwrapPreserveWords(res.description, 600);
if(res.attribution?.description) result.description += `\n\n-# Source • ${res.attribution.description}`