From 93e00e7afb854c76c0e5cdfe707c0e6891d1043a Mon Sep 17 00:00:00 2001 From: Gelaechter <30231932+gelaechter@users.noreply.github.com> Date: Sat, 29 Jul 2023 17:35:30 +0000 Subject: [PATCH] Fix Jellyfin album duration normalization (#191) --- src/renderer/api/jellyfin/jellyfin-normalize.ts | 2 +- .../features/albums/components/album-detail-header.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/renderer/api/jellyfin/jellyfin-normalize.ts b/src/renderer/api/jellyfin/jellyfin-normalize.ts index ed4dc1ec..5d3b5cb3 100644 --- a/src/renderer/api/jellyfin/jellyfin-normalize.ts +++ b/src/renderer/api/jellyfin/jellyfin-normalize.ts @@ -201,7 +201,7 @@ const normalizeAlbum = ( })), backdropImageUrl: null, createdAt: item.DateCreated, - duration: item.RunTimeTicks / 10000, + duration: item.RunTimeTicks / 10000000, genres: item.GenreItems?.map((entry) => ({ id: entry.Id, name: entry.Name })), id: item.Id, imagePlaceholderUrl: null, diff --git a/src/renderer/features/albums/components/album-detail-header.tsx b/src/renderer/features/albums/components/album-detail-header.tsx index 7c648d14..af3fc0cb 100644 --- a/src/renderer/features/albums/components/album-detail-header.tsx +++ b/src/renderer/features/albums/components/album-detail-header.tsx @@ -37,7 +37,8 @@ export const AlbumDetailHeader = forwardRef( id: 'duration', secondary: false, value: - detailQuery?.data?.duration && formatDurationString(detailQuery.data.duration), + detailQuery?.data?.duration && + formatDurationString(detailQuery.data.duration * 1000), }, ];