From 5ec3253fc1c5fe855f9a68374edbb4204a19f2d9 Mon Sep 17 00:00:00 2001 From: Violet Caulfield Date: Mon, 10 Feb 2025 07:33:11 -0600 Subject: [PATCH] fix build? --- App.tsx | 2 +- helpers/runtimeticks.ts | 26 ++++++++++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/App.tsx b/App.tsx index f7f21a24..fea0523d 100644 --- a/App.tsx +++ b/App.tsx @@ -11,7 +11,7 @@ import { queryClient } from './constants/query-client'; import { GestureHandlerRootView } from 'react-native-gesture-handler'; import { createWorkletRuntime } from 'react-native-reanimated'; -export const backgroundRuntime = createWorkletRuntime('background'); +// export const backgroundRuntime = createWorkletRuntime('background'); export default function App(): React.JSX.Element { diff --git a/helpers/runtimeticks.ts b/helpers/runtimeticks.ts index 4d01be86..90b3d6eb 100644 --- a/helpers/runtimeticks.ts +++ b/helpers/runtimeticks.ts @@ -1,18 +1,32 @@ -import { backgroundRuntime } from "@/App"; +// import { backgroundRuntime } from "@/App"; import { runOnRuntime } from "react-native-reanimated"; +/** + * Converts the run time seconds of a track to the RunTimeTicks standard set by Emby / Jellyfin + * @param seconds The run time seconds of the item to convert to Jellyfin ticks + * @returns the run time seconds of a track converted to Jellyfin runtimeticks + * + * @see https://emby.media/community/index.php?/topic/63357-runtimeticks-microseconds-milliseconds-or-nanoseconds/ + */ export function convertSecondsToRunTimeTicks(seconds: number) { - return runOnRuntime(backgroundRuntime, (runTimeSeconds: number) => { + // return runOnRuntime(backgroundRuntime, (runTimeSeconds: number) => { const runTimeMilliseconds = seconds * 1000 * 10000; return runTimeMilliseconds; - })(seconds); + // })(seconds); } +/** + * Converts a {@link BaseItemDto}'s RunTimeTicks to seconds + * @param ticks The run time ticks of the item to convert to seconds + * @returns The run time ticks of a track converted to seconds + * + * @see https://emby.media/community/index.php?/topic/63357-runtimeticks-microseconds-milliseconds-or-nanoseconds/ + */ export function convertRunTimeTicksToSeconds(ticks: number) { - return runOnRuntime(backgroundRuntime, (runTimeTicks : number) => { - const runTimeMilliseconds = runTimeTicks / 10000; + // return runOnRuntime(backgroundRuntime, (runTimeTicks : number) => { + const runTimeMilliseconds = ticks / 10000; const runTimeTotalSeconds = Math.floor(runTimeMilliseconds / 1000); return runTimeTotalSeconds; - })(ticks); + // })(ticks); } \ No newline at end of file