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,
|
container: (item.MediaSources && item.MediaSources[0]?.Container) || null,
|
||||||
createdAt: item.DateCreated,
|
createdAt: item.DateCreated,
|
||||||
discNumber: (item.ParentIndexNumber && item.ParentIndexNumber) || 1,
|
discNumber: (item.ParentIndexNumber && item.ParentIndexNumber) || 1,
|
||||||
duration: item.RunTimeTicks / 10000000,
|
duration: item.RunTimeTicks / 10000,
|
||||||
genres: item.GenreItems?.map((entry) => ({
|
genres: item.GenreItems?.map((entry) => ({
|
||||||
id: entry.Id,
|
id: entry.Id,
|
||||||
imageUrl: null,
|
imageUrl: null,
|
||||||
|
|
|
@ -89,7 +89,7 @@ const normalizeSong = (
|
||||||
container: item.suffix,
|
container: item.suffix,
|
||||||
createdAt: item.createdAt.split('T')[0],
|
createdAt: item.createdAt.split('T')[0],
|
||||||
discNumber: item.discNumber,
|
discNumber: item.discNumber,
|
||||||
duration: item.duration,
|
duration: item.duration * 1000,
|
||||||
genres: item.genres?.map((genre) => ({
|
genres: item.genres?.map((genre) => ({
|
||||||
id: genre.id,
|
id: genre.id,
|
||||||
imageUrl: null,
|
imageUrl: null,
|
||||||
|
|
|
@ -189,7 +189,7 @@ const tableColumns: { [key: string]: ColDef } = {
|
||||||
headerComponent: (params: IHeaderParams) =>
|
headerComponent: (params: IHeaderParams) =>
|
||||||
GenericTableHeader(params, { position: 'center', preset: 'duration' }),
|
GenericTableHeader(params, { position: 'center', preset: 'duration' }),
|
||||||
suppressSizeToFit: true,
|
suppressSizeToFit: true,
|
||||||
valueFormatter: (params: ValueFormatterParams) => formatDuration(params.value * 1000),
|
valueFormatter: (params: ValueFormatterParams) => formatDuration(Number(params.value)),
|
||||||
valueGetter: (params: ValueGetterParams) =>
|
valueGetter: (params: ValueGetterParams) =>
|
||||||
params.data ? params.data.duration : undefined,
|
params.data ? params.data.duration : undefined,
|
||||||
width: 70,
|
width: 70,
|
||||||
|
|
|
@ -124,7 +124,7 @@ export const CenterControls = ({ playersRef }: CenterControlsProps) => {
|
||||||
|
|
||||||
const currentTime = useCurrentTime();
|
const currentTime = useCurrentTime();
|
||||||
const currentPlayerRef = player === 1 ? player1 : player2;
|
const currentPlayerRef = player === 1 ? player1 : player2;
|
||||||
const duration = formatDuration((songDuration || 0) * 1000);
|
const duration = formatDuration(songDuration || 0);
|
||||||
const formattedTime = formatDuration(currentTime * 1000 || 0);
|
const formattedTime = formatDuration(currentTime * 1000 || 0);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
Reference in a new issue