aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Media/anime.ts
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-12-13 18:54:35 -0800
committerFuwn <[email protected]>2023-12-13 18:54:35 -0800
commit77332f34ae861f1a78acd1e74011299a8bb35665 (patch)
tree65fb9d16aac7ffed6dae46ba6222cb4c32d8197d /src/lib/Media/anime.ts
parentstyle(AniList): simplify (diff)
downloaddue.moe-77332f34ae861f1a78acd1e74011299a8bb35665.tar.xz
due.moe-77332f34ae861f1a78acd1e74011299a8bb35665.zip
style(Media): simplify statements
Diffstat (limited to 'src/lib/Media/anime.ts')
-rw-r--r--src/lib/Media/anime.ts9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/Media/anime.ts b/src/lib/Media/anime.ts
index 937e9dac..0cc854e7 100644
--- a/src/lib/Media/anime.ts
+++ b/src/lib/Media/anime.ts
@@ -47,9 +47,7 @@ export const airingTime = (anime: Media, upcoming = false) => {
timeFrame = `${days.toFixed(0)} day${days === 1 ? '' : 's'}`;
// }
- } else {
- timeFrame = `${hours.toFixed(1)} hour${hours === 1 ? '' : 's'}`;
- }
+ } else timeFrame = `${hours.toFixed(1)} hour${hours === 1 ? '' : 's'}`;
} else {
minutes = Math.round(minutes);
@@ -58,19 +56,18 @@ export const airingTime = (anime: Media, upcoming = false) => {
const opacity = Math.max(50, 100 - (untilAiring / 60 / 60 / 24 / 7) * 50);
- if (upcoming) {
+ if (upcoming)
return `<span title="${
hours ? `${hours.toFixed(3)} hours` : ''
}" style="opacity: ${opacity}%">${anime.nextAiringEpisode?.episode}${totalEpisodes(
anime
)} in ${timeFrame} <span style="opacity: 50%">${few ? `(${time})` : ''}</span></span>`;
- } else {
+ else
return `<span title="${
hours ? `${hours.toFixed(3)} hours` : ''
}" style="opacity: ${opacity}%">${anime.nextAiringEpisode?.episode} in ${
few ? '<b>' : ''
}${timeFrame}${few ? '</b>' : ''} ${few ? `(${time})` : ''}</span>`;
- }
}
return '';