Fix nd/jf duration normalizations
This commit is contained in:
parent
5e33212112
commit
153d8ce6ce
4 changed files with 4 additions and 4 deletions
|
@ -150,7 +150,7 @@ const normalizeSong = (
|
|||
container: (item.MediaSources && item.MediaSources[0]?.Container) || null,
|
||||
createdAt: item.DateCreated,
|
||||
discNumber: (item.ParentIndexNumber && item.ParentIndexNumber) || 1,
|
||||
duration: item.RunTimeTicks / 10000000,
|
||||
duration: item.RunTimeTicks / 10000,
|
||||
genres: item.GenreItems?.map((entry) => ({
|
||||
id: entry.Id,
|
||||
imageUrl: null,
|
||||
|
|
|
@ -89,7 +89,7 @@ const normalizeSong = (
|
|||
container: item.suffix,
|
||||
createdAt: item.createdAt.split('T')[0],
|
||||
discNumber: item.discNumber,
|
||||
duration: item.duration,
|
||||
duration: item.duration * 1000,
|
||||
genres: item.genres?.map((genre) => ({
|
||||
id: genre.id,
|
||||
imageUrl: null,
|
||||
|
|
|
@ -189,7 +189,7 @@ const tableColumns: { [key: string]: ColDef } = {
|
|||
headerComponent: (params: IHeaderParams) =>
|
||||
GenericTableHeader(params, { position: 'center', preset: 'duration' }),
|
||||
suppressSizeToFit: true,
|
||||
valueFormatter: (params: ValueFormatterParams) => formatDuration(params.value * 1000),
|
||||
valueFormatter: (params: ValueFormatterParams) => formatDuration(Number(params.value)),
|
||||
valueGetter: (params: ValueGetterParams) =>
|
||||
params.data ? params.data.duration : undefined,
|
||||
width: 70,
|
||||
|
|
|
@ -124,7 +124,7 @@ export const CenterControls = ({ playersRef }: CenterControlsProps) => {
|
|||
|
||||
const currentTime = useCurrentTime();
|
||||
const currentPlayerRef = player === 1 ? player1 : player2;
|
||||
const duration = formatDuration((songDuration || 0) * 1000);
|
||||
const duration = formatDuration(songDuration || 0);
|
||||
const formattedTime = formatDuration(currentTime * 1000 || 0);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
Reference in a new issue