From d482750576bca97dab1fa4f34ade032a31e3712d Mon Sep 17 00:00:00 2001 From: Kentai Radiquum Date: Mon, 23 Sep 2024 18:29:58 +0500 Subject: [PATCH] fix: episode duration on release page --- app/api/utils.ts | 2 +- app/components/ReleaseInfo/ReleaseInfo.Info.tsx | 2 +- public/changelog/3.2.1.md | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/api/utils.ts b/app/api/utils.ts index 9fa41c7..da7c6fa 100644 --- a/app/api/utils.ts +++ b/app/api/utils.ts @@ -200,7 +200,7 @@ export function minutesToTime( if (h > 0) return hDisplay; if (m > 0) return mDisplay; } else { - return `${dDisplay}${h > 0 && ", " + hDisplay}${m > 0 && ", " + mDisplay}`; + return `${d > 0 ? dDisplay : ""}${h > 0 ? ", " + hDisplay : ""}${m > 0 ? ", " + mDisplay : ""}`; } } diff --git a/app/components/ReleaseInfo/ReleaseInfo.Info.tsx b/app/components/ReleaseInfo/ReleaseInfo.Info.tsx index 0f6e93e..04c0ce2 100644 --- a/app/components/ReleaseInfo/ReleaseInfo.Info.tsx +++ b/app/components/ReleaseInfo/ReleaseInfo.Info.tsx @@ -59,7 +59,7 @@ export const ReleaseInfoInfo = (props: { {props.episodes.released ? props.episodes.released : "?"} {"/"} {props.episodes.total ? props.episodes.total + " эп. " : "? эп. "} - {props.duration != 0 && `по ${minutesToTime(props.duration)}`} + {props.duration != 0 && `по ${minutesToTime(props.duration, "daysHours")}`} diff --git a/public/changelog/3.2.1.md b/public/changelog/3.2.1.md index ac21f69..01a8c1a 100644 --- a/public/changelog/3.2.1.md +++ b/public/changelog/3.2.1.md @@ -13,3 +13,4 @@ - Исправлена горизонтальная прокрутка профиля на мобильных устройствах - Исправлена ошибка если не найдено эпизодов в изначальном источнике +- Исправлен показ длительности эпизода