mirror of
https://github.com/Jellify-Music/App.git
synced 2026-05-02 08:39:23 -05:00
background stuff
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { runOnRuntime } from "react-native-reanimated";
|
||||
import { convertRunTimeTicksToSeconds } from "../../../helpers/runtimeticks";
|
||||
import { Text } from "./text";
|
||||
import React from "react";
|
||||
import { backgroundRuntime } from "@/App";
|
||||
|
||||
export function RunTimeSeconds({ children }: { children: number }) : React.JSX.Element {
|
||||
return <Text bold>{ calculateRunTimeFromSeconds(children) }</Text>
|
||||
@@ -10,7 +12,9 @@ export function RunTimeTicks({ children } : { children?: number | null | undefin
|
||||
if (!!!children)
|
||||
return <Text>0:00</Text>
|
||||
|
||||
let time = calculateRunTimeFromTicks(children);
|
||||
let time = runOnRuntime(backgroundRuntime, (ticks : number) => {
|
||||
return calculateRunTimeFromTicks(ticks)
|
||||
})(children);
|
||||
|
||||
return (
|
||||
<Text
|
||||
|
||||
@@ -9,7 +9,7 @@ import { runOnRuntime } from "react-native-reanimated";
|
||||
*
|
||||
* @see https://emby.media/community/index.php?/topic/63357-runtimeticks-microseconds-milliseconds-or-nanoseconds/
|
||||
*/
|
||||
export function convertSecondsToRunTimeTicks(seconds: number) {
|
||||
export function convertSecondsToRunTimeTicks(seconds: number) : number {
|
||||
return runOnRuntime(backgroundRuntime, (runTimeSeconds: number) => {
|
||||
'worklet';
|
||||
const runTimeMilliseconds = runTimeSeconds * 1000 * 10000;
|
||||
@@ -25,7 +25,7 @@ export function convertSecondsToRunTimeTicks(seconds: number) {
|
||||
*
|
||||
* @see https://emby.media/community/index.php?/topic/63357-runtimeticks-microseconds-milliseconds-or-nanoseconds/
|
||||
*/
|
||||
export function convertRunTimeTicksToSeconds(ticks: number) {
|
||||
export function convertRunTimeTicksToSeconds(ticks: number) : number {
|
||||
return runOnRuntime(backgroundRuntime, (runTimeTicks : number) => {
|
||||
'worklet';
|
||||
const runTimeMilliseconds = runTimeTicks / 10000;
|
||||
|
||||
Reference in New Issue
Block a user