mirror of
https://github.com/anultravioletaurora/Jellify.git
synced 2025-12-21 13:30:11 -06:00
fix build?
This commit is contained in:
2
App.tsx
2
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 {
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user