Compare commits
1
Commits
No files matched your search
+2
-2
@@ -121,7 +121,7 @@ RUN curl -fsSL -o ffmpeg.tar.xz "https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VER
|
||||
|
||||
# Decoders cover the library formats (FLAC, ALAC/AAC in m4a, MP3, Opus,
|
||||
# Vorbis, WavPack, WMA, E-AC-3/TrueHD for Atmos). Encoders are only the two
|
||||
# the app writes: AAC (HLS, ADTS and .m4a downloads) and FLAC.
|
||||
# the app writes: AAC (HLS and ADTS) and FLAC.
|
||||
RUN ./configure \
|
||||
--prefix=/opt/ffmpeg \
|
||||
--disable-shared \
|
||||
@@ -138,7 +138,7 @@ RUN ./configure \
|
||||
--enable-demuxer=aac,ac3,aiff,ape,asf,au,caf,dsf,flac,matroska,mov,mp3,ogg,wav,wv \
|
||||
--enable-decoder=aac,aac_latm,ac3,alac,ape,dsd_lsbf,dsd_msbf,eac3,flac,mlp,mp3,opus,pcm_f32le,pcm_s16be,pcm_s16le,pcm_s24be,pcm_s24le,pcm_s32be,pcm_s32le,pcm_u8,truehd,vorbis,wavpack,wmav1,wmav2 \
|
||||
--enable-encoder=aac,flac \
|
||||
--enable-muxer=adts,flac,hls,ipod,mpegts \
|
||||
--enable-muxer=adts,flac,hls,mpegts \
|
||||
--enable-parser=aac,aac_latm,ac3,flac,mpegaudio,opus,vorbis \
|
||||
--enable-bsf=aac_adtstoasc \
|
||||
--enable-filter=aresample,aformat \
|
||||
|
||||
@@ -32,13 +32,6 @@ export default ({ config }: ConfigContext): ExpoConfig => {
|
||||
...config,
|
||||
plugins: [
|
||||
...(config.plugins ?? []),
|
||||
[
|
||||
"react-native-continued-task",
|
||||
{
|
||||
// Matches TASK_PREFIX in hooks/use-background-downloads.ts.
|
||||
identifierPrefixes: [`${bundleIdentifier}.downloads`],
|
||||
},
|
||||
],
|
||||
...(process.env.MAC_CATALYST === "1"
|
||||
? ["./plugins/with-mac-catalyst"]
|
||||
: []),
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
import {
|
||||
atmosEnabled,
|
||||
deviceDownloadQualities,
|
||||
dolbyAtmosSupported,
|
||||
} from "@/lib/playback-capabilities"
|
||||
import { atmosEnabled, dolbyAtmosSupported } from "@/lib/playback-capabilities"
|
||||
import { Ionicons } from "@expo/vector-icons"
|
||||
import { useAction, useMutation, useQuery } from "convex/react"
|
||||
import { Image } from "expo-image"
|
||||
@@ -29,6 +25,7 @@ import {
|
||||
writeRememberedDownloadQuality,
|
||||
} from "@/lib/downloads"
|
||||
import {
|
||||
DOWNLOAD_QUALITIES,
|
||||
DOWNLOAD_QUALITY_DETAILS,
|
||||
DOWNLOAD_QUALITY_LABELS,
|
||||
formatBytes,
|
||||
@@ -453,10 +450,9 @@ function QualitySection({ user }: { user: CurrentUser }) {
|
||||
|
||||
/** Shades of the text color, faintest for the smallest files. */
|
||||
const QUALITY_OPACITY: Record<DownloadQuality, number> = {
|
||||
low: 0.2,
|
||||
medium: 0.35,
|
||||
high: 0.5,
|
||||
lossless: 0.75,
|
||||
medium: 0.25,
|
||||
high: 0.45,
|
||||
lossless: 0.7,
|
||||
atmos: 1,
|
||||
}
|
||||
|
||||
@@ -511,7 +507,7 @@ function RememberedQualityCard() {
|
||||
detail: string
|
||||
}[] = [
|
||||
{ value: null, label: "Ask every time", detail: "Choose when downloading" },
|
||||
...deviceDownloadQualities.map((quality) => ({
|
||||
...DOWNLOAD_QUALITIES.map((quality) => ({
|
||||
value: quality,
|
||||
label: DOWNLOAD_QUALITY_LABELS[quality],
|
||||
detail: DOWNLOAD_QUALITY_DETAILS[quality],
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
import {
|
||||
memo,
|
||||
type ComponentType,
|
||||
type ReactElement,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from "react"
|
||||
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react"
|
||||
import {
|
||||
Pressable,
|
||||
ScrollView,
|
||||
@@ -15,11 +6,14 @@ import {
|
||||
Text,
|
||||
View,
|
||||
type ScrollViewInstance,
|
||||
type ViewProps,
|
||||
} from "react-native"
|
||||
import MaskedViewClass from "@react-native-masked-view/masked-view"
|
||||
import Animated, {
|
||||
cancelAnimation,
|
||||
Easing,
|
||||
useAnimatedStyle,
|
||||
useSharedValue,
|
||||
withSequence,
|
||||
withTiming,
|
||||
type SharedValue,
|
||||
} from "react-native-reanimated"
|
||||
|
||||
@@ -28,7 +22,7 @@ import {
|
||||
usePlaybackProgress,
|
||||
usePlaybackQueue,
|
||||
} from "@/contexts/playback"
|
||||
import { useLyricsTime, usePlaybackClock } from "@/hooks/use-lyrics"
|
||||
import { useLyricsTime } from "@/hooks/use-lyrics"
|
||||
import type { NowPlayingColors } from "@/lib/now-playing-colors"
|
||||
import {
|
||||
activeLineIndex,
|
||||
@@ -37,21 +31,12 @@ import {
|
||||
type Lyrics,
|
||||
} from "@otunes/convex/client/lyrics"
|
||||
|
||||
// The package's class typings predate React 19's; this is its documented API.
|
||||
const MaskedView = MaskedViewClass as unknown as ComponentType<
|
||||
ViewProps & { maskElement: ReactElement }
|
||||
>
|
||||
|
||||
/** How long a manual scroll keeps the view from following the song. */
|
||||
const MANUAL_SCROLL_HOLD_MS = 3000
|
||||
/** Where the playing line sits, as a share of the view's height from the top. */
|
||||
const ACTIVE_LINE_POSITION = 0.12
|
||||
/** Blur radius by distance from the playing line; farther lines share the last. */
|
||||
const LINE_BLUR = [0, 1, 2, 3]
|
||||
/** Opacity of lines other than the one playing. */
|
||||
const INACTIVE_LINE_OPACITY = 0.35
|
||||
/** How long a line takes to brighten, dim, or change blur. */
|
||||
const LINE_FADE_MS = 300
|
||||
|
||||
/**
|
||||
* Lyrics in the player's own colors. Synced lines follow playback and seek
|
||||
@@ -92,7 +77,6 @@ function LyricsLines({
|
||||
const { isPlaying } = usePlaybackQueue()
|
||||
const { seekTo, setIsPlaying } = usePlaybackActions()
|
||||
const time = useLyricsTime(lyrics, currentTime, isPlaying)
|
||||
const clock = usePlaybackClock(currentTime, isPlaying)
|
||||
const active = activeLineIndex(lyrics, time)
|
||||
const synced = lyrics.synced !== "none"
|
||||
const scrollRef = useRef<ScrollViewInstance>(null)
|
||||
@@ -186,7 +170,8 @@ function LyricsLines({
|
||||
: Math.min(Math.abs(index - active), LINE_BLUR.length - 1)
|
||||
}
|
||||
active={index === active}
|
||||
clock={clock}
|
||||
time={index === active ? time : null}
|
||||
isPlaying={isPlaying}
|
||||
colors={colors}
|
||||
textStyle={lineStyle}
|
||||
onSelect={playFrom}
|
||||
@@ -214,16 +199,17 @@ function LyricsLines({
|
||||
}
|
||||
|
||||
/**
|
||||
* One timed line, laid out word by word whether or not it is playing, so it
|
||||
* never re-wraps. It fades and blurs by its `distance` from the playing line,
|
||||
* and only the playing line's words fill.
|
||||
* One timed line, blurred by its `distance` from the playing line. Only the
|
||||
* playing line gets the time, so the others skip re-rendering as the song
|
||||
* plays.
|
||||
*/
|
||||
const SyncedLine = memo(function SyncedLine({
|
||||
index,
|
||||
line,
|
||||
distance,
|
||||
active,
|
||||
clock,
|
||||
time,
|
||||
isPlaying,
|
||||
colors,
|
||||
textStyle,
|
||||
onSelect,
|
||||
@@ -233,100 +219,140 @@ const SyncedLine = memo(function SyncedLine({
|
||||
line: LyricLine
|
||||
distance: number
|
||||
active: boolean
|
||||
clock: SharedValue<number>
|
||||
time: number | null
|
||||
isPlaying: boolean
|
||||
colors: NowPlayingColors
|
||||
textStyle: { fontSize: number; lineHeight: number }
|
||||
onSelect: (seconds: number) => void
|
||||
onLayoutY: (index: number, y: number) => void
|
||||
}) {
|
||||
const wordStyle = [styles.lineText, textStyle, { color: colors.foreground }]
|
||||
const blur = LINE_BLUR[distance]
|
||||
return (
|
||||
<Pressable
|
||||
onPress={() => onSelect(line.start ?? 0)}
|
||||
onLayout={(event) => onLayoutY(index, event.nativeEvent.layout.y)}
|
||||
accessibilityRole="button"
|
||||
accessibilityHint="Plays from this line"
|
||||
style={styles.line}
|
||||
style={[styles.line, blur > 0 && { filter: [{ blur }] }]}
|
||||
>
|
||||
<Animated.View
|
||||
style={{
|
||||
opacity: active ? 1 : INACTIVE_LINE_OPACITY,
|
||||
filter: [{ blur: LINE_BLUR[distance] }],
|
||||
transitionProperty: ["opacity", "filter"],
|
||||
transitionDuration: LINE_FADE_MS,
|
||||
}}
|
||||
>
|
||||
{line.words ? (
|
||||
<View
|
||||
style={[styles.words, { columnGap: textStyle.fontSize * 0.25 }]}
|
||||
>
|
||||
{line.words.map((word, wordIndex) =>
|
||||
active ? (
|
||||
<FilledWord
|
||||
key={wordIndex}
|
||||
word={word}
|
||||
clock={clock}
|
||||
colors={colors}
|
||||
textStyle={textStyle}
|
||||
/>
|
||||
) : (
|
||||
<Text key={wordIndex} style={wordStyle}>
|
||||
{word.text.trim()}
|
||||
</Text>
|
||||
)
|
||||
)}
|
||||
</View>
|
||||
) : (
|
||||
<Text style={wordStyle}>{line.text}</Text>
|
||||
)}
|
||||
</Animated.View>
|
||||
{active && line.words && time !== null ? (
|
||||
<FilledWords
|
||||
words={line.words}
|
||||
time={time}
|
||||
isPlaying={isPlaying}
|
||||
colors={colors}
|
||||
textStyle={textStyle}
|
||||
/>
|
||||
) : (
|
||||
<Text
|
||||
style={[
|
||||
styles.lineText,
|
||||
textStyle,
|
||||
{
|
||||
color:
|
||||
active && !line.words
|
||||
? colors.foreground
|
||||
: colors.lyricsInactive,
|
||||
},
|
||||
]}
|
||||
>
|
||||
{line.text}
|
||||
</Text>
|
||||
)}
|
||||
</Pressable>
|
||||
)
|
||||
})
|
||||
|
||||
/**
|
||||
* A word of the playing line, filled from dim to bright with a soft edge as
|
||||
* it is sung: a gradient 2.5 times its width slides under the word's
|
||||
* shape, like the web panel's.
|
||||
* The playing line's words, each wiping from dim to bright as it is sung.
|
||||
* Reanimated runs the wipe; playback updates only re-anchor it.
|
||||
*/
|
||||
function FilledWords({
|
||||
words,
|
||||
time,
|
||||
isPlaying,
|
||||
colors,
|
||||
textStyle,
|
||||
}: {
|
||||
words: LyricWord[]
|
||||
time: number
|
||||
isPlaying: boolean
|
||||
colors: NowPlayingColors
|
||||
textStyle: { fontSize: number; lineHeight: number }
|
||||
}) {
|
||||
const sung = useSharedValue(time)
|
||||
const end = words.at(-1)?.end ?? time
|
||||
|
||||
useEffect(() => {
|
||||
cancelAnimation(sung)
|
||||
// Jump to the reported time first, so the wipe never runs from a stale one.
|
||||
sung.value =
|
||||
isPlaying && end > time
|
||||
? withSequence(
|
||||
withTiming(time, { duration: 0 }),
|
||||
withTiming(end, {
|
||||
duration: (end - time) * 1000,
|
||||
easing: Easing.linear,
|
||||
})
|
||||
)
|
||||
: time
|
||||
}, [sung, time, isPlaying, end])
|
||||
|
||||
return (
|
||||
<View style={[styles.words, { columnGap: textStyle.fontSize * 0.25 }]}>
|
||||
{words.map((word, index) => (
|
||||
<FilledWord
|
||||
key={index}
|
||||
word={word}
|
||||
sung={sung}
|
||||
colors={colors}
|
||||
textStyle={textStyle}
|
||||
/>
|
||||
))}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
function FilledWord({
|
||||
word,
|
||||
clock,
|
||||
sung,
|
||||
colors,
|
||||
textStyle,
|
||||
}: {
|
||||
word: LyricWord
|
||||
clock: SharedValue<number>
|
||||
sung: SharedValue<number>
|
||||
colors: NowPlayingColors
|
||||
textStyle: { fontSize: number; lineHeight: number }
|
||||
}) {
|
||||
const [width, setWidth] = useState(0)
|
||||
const text = word.text.trim()
|
||||
const slide = useAnimatedStyle(() => {
|
||||
const wipe = useAnimatedStyle(() => {
|
||||
const progress =
|
||||
(clock.value - word.start) / Math.max(word.end - word.start, 0.05)
|
||||
const sung = Math.min(Math.max(progress, 0), 1)
|
||||
// -60% of the gradient's width shows its dim end; 0% its bright one.
|
||||
return { transform: [{ translateX: `${-60 * (1 - sung)}%` }] }
|
||||
(sung.value - word.start) / Math.max(word.end - word.start, 0.05)
|
||||
return { width: width * Math.min(Math.max(progress, 0), 1) }
|
||||
})
|
||||
|
||||
return (
|
||||
<MaskedView
|
||||
maskElement={
|
||||
<Text style={[styles.lineText, textStyle, styles.mask]}>{text}</Text>
|
||||
}
|
||||
>
|
||||
{/* Sizes the word; the mask draws it. */}
|
||||
<Text style={[styles.lineText, textStyle, styles.hidden]}>{text}</Text>
|
||||
<Animated.View
|
||||
style={[
|
||||
styles.fillGradient,
|
||||
{
|
||||
backgroundImage: `linear-gradient(90deg, ${colors.foreground} 40%, ${colors.lyricsUnsung} 60%)`,
|
||||
},
|
||||
slide,
|
||||
]}
|
||||
/>
|
||||
</MaskedView>
|
||||
<View>
|
||||
<Text
|
||||
style={[styles.lineText, textStyle, { color: colors.lyricsUnsung }]}
|
||||
onLayout={(event) => setWidth(event.nativeEvent.layout.width)}
|
||||
>
|
||||
{text}
|
||||
</Text>
|
||||
<Animated.View style={[styles.wipe, wipe]}>
|
||||
<Text
|
||||
numberOfLines={1}
|
||||
style={[
|
||||
styles.lineText,
|
||||
textStyle,
|
||||
{ color: colors.foreground, width },
|
||||
]}
|
||||
>
|
||||
{text}
|
||||
</Text>
|
||||
</Animated.View>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -337,14 +363,12 @@ const styles = StyleSheet.create({
|
||||
line: { paddingVertical: 9 },
|
||||
lineText: { fontWeight: "800" },
|
||||
words: { flexDirection: "row", flexWrap: "wrap" },
|
||||
mask: { color: "black" },
|
||||
hidden: { opacity: 0 },
|
||||
fillGradient: {
|
||||
wipe: {
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
width: "250%",
|
||||
overflow: "hidden",
|
||||
},
|
||||
plainLine: { fontWeight: "700", paddingVertical: 2 },
|
||||
stanzaGap: { height: 18 },
|
||||
|
||||
@@ -25,7 +25,6 @@ import { AndroidSheet } from "@/components/android-sheet"
|
||||
import { AudioFormatBadge } from "@/components/audio-format-badge"
|
||||
import { useCacheScope } from "@/contexts/persistent-cache"
|
||||
import { useServerConfig } from "@/contexts/server-config"
|
||||
import { useBackgroundDownloads } from "@/hooks/use-background-downloads"
|
||||
import { useCachedQuery } from "@/hooks/use-cached-query"
|
||||
import { getAuthCookieHeader } from "@/lib/auth-cookies"
|
||||
import {
|
||||
@@ -34,7 +33,6 @@ import {
|
||||
writeRememberedDownloadQuality,
|
||||
} from "@/lib/downloads"
|
||||
import { loadPlaybackSongs } from "@/lib/playback-files"
|
||||
import { downloadQualitySupported } from "@/lib/playback-capabilities"
|
||||
import type { ServerConfig } from "@/lib/server-config"
|
||||
import { showError } from "@/lib/toast"
|
||||
import { useThemeColors } from "@/lib/theme"
|
||||
@@ -239,44 +237,36 @@ function DownloadQualityPopup({
|
||||
>
|
||||
{pending?.target.title}
|
||||
</Text>
|
||||
{pending?.response.options
|
||||
.filter((option) => downloadQualitySupported(option.quality))
|
||||
.map((option) => (
|
||||
<Pressable
|
||||
key={option.quality}
|
||||
accessibilityRole="button"
|
||||
style={[styles.row, { borderBottomColor: colors.border }]}
|
||||
onPress={() => onPick(option.quality, remember)}
|
||||
>
|
||||
<View style={styles.rowText}>
|
||||
{option.quality === "lossless" ||
|
||||
option.quality === "atmos" ? (
|
||||
<AudioFormatBadge
|
||||
format={option.quality}
|
||||
color={colors.foreground}
|
||||
backgroundColor={colors.card}
|
||||
/>
|
||||
) : (
|
||||
<Text
|
||||
style={[styles.label, { color: colors.foreground }]}
|
||||
>
|
||||
{DOWNLOAD_QUALITY_LABELS[option.quality]}
|
||||
</Text>
|
||||
)}
|
||||
<Text
|
||||
style={{ color: colors.mutedForeground, fontSize: 12 }}
|
||||
>
|
||||
{optionDetail(option, songCount)}
|
||||
{pending?.response.options.map((option) => (
|
||||
<Pressable
|
||||
key={option.quality}
|
||||
accessibilityRole="button"
|
||||
style={[styles.row, { borderBottomColor: colors.border }]}
|
||||
onPress={() => onPick(option.quality, remember)}
|
||||
>
|
||||
<View style={styles.rowText}>
|
||||
{option.quality === "lossless" ||
|
||||
option.quality === "atmos" ? (
|
||||
<AudioFormatBadge
|
||||
format={option.quality}
|
||||
color={colors.foreground}
|
||||
backgroundColor={colors.card}
|
||||
/>
|
||||
) : (
|
||||
<Text style={[styles.label, { color: colors.foreground }]}>
|
||||
{DOWNLOAD_QUALITY_LABELS[option.quality]}
|
||||
</Text>
|
||||
</View>
|
||||
<Text
|
||||
style={[styles.size, { color: colors.mutedForeground }]}
|
||||
>
|
||||
{option.estimated ? "~" : ""}
|
||||
{formatBytes(option.bytes)}
|
||||
)}
|
||||
<Text style={{ color: colors.mutedForeground, fontSize: 12 }}>
|
||||
{optionDetail(option, songCount)}
|
||||
</Text>
|
||||
</Pressable>
|
||||
))}
|
||||
</View>
|
||||
<Text style={[styles.size, { color: colors.mutedForeground }]}>
|
||||
{option.estimated ? "~" : ""}
|
||||
{formatBytes(option.bytes)}
|
||||
</Text>
|
||||
</Pressable>
|
||||
))}
|
||||
<View style={styles.rememberRow}>
|
||||
<Text style={{ color: colors.foreground, fontSize: 15 }}>
|
||||
Remember my choice
|
||||
@@ -354,7 +344,6 @@ export function DownloadsProvider({ children }: { children: ReactNode }) {
|
||||
target: DownloadTarget
|
||||
response: DownloadOptionsResponse
|
||||
} | null>(null)
|
||||
const keepDownloading = useBackgroundDownloads(queue)
|
||||
|
||||
useEffect(() => {
|
||||
if (!queue) return
|
||||
@@ -402,7 +391,6 @@ export function DownloadsProvider({ children }: { children: ReactNode }) {
|
||||
const remembered = await readRememberedDownloadQuality()
|
||||
if (remembered) {
|
||||
await startDownload(queue, target, response.songs, remembered)
|
||||
keepDownloading()
|
||||
toast(`Downloading ${target.title}`)
|
||||
} else {
|
||||
setPending({ target, response })
|
||||
@@ -411,7 +399,7 @@ export function DownloadsProvider({ children }: { children: ReactNode }) {
|
||||
showError(error instanceof Error ? error.message : "Download failed")
|
||||
}
|
||||
},
|
||||
[cacheScope, config, convex, keepDownloading, queue]
|
||||
[cacheScope, config, convex, queue]
|
||||
)
|
||||
|
||||
const removeDownload = useCallback(
|
||||
@@ -429,14 +417,9 @@ export function DownloadsProvider({ children }: { children: ReactNode }) {
|
||||
if (!pending || !queue) return
|
||||
setPending(null)
|
||||
if (remember) void writeRememberedDownloadQuality(quality)
|
||||
void startDownload(
|
||||
queue,
|
||||
pending.target,
|
||||
pending.response.songs,
|
||||
quality
|
||||
).then(keepDownloading)
|
||||
void startDownload(queue, pending.target, pending.response.songs, quality)
|
||||
},
|
||||
[keepDownloading, pending, queue]
|
||||
[pending, queue]
|
||||
)
|
||||
|
||||
const value = useMemo(
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
import { requireOptionalNativeModule } from "expo"
|
||||
import Constants from "expo-constants"
|
||||
import { useCallback, useEffect, useRef } from "react"
|
||||
import { AppState, Platform } from "react-native"
|
||||
import {
|
||||
ContinuedTasks,
|
||||
type ContinuedTask,
|
||||
} from "react-native-continued-task"
|
||||
|
||||
import { setKeptRunning } from "@/lib/downloads"
|
||||
import type { DownloadQueue } from "@otunes/convex/client/download-queue"
|
||||
|
||||
const downloadService = requireOptionalNativeModule<{
|
||||
update: (remaining: number) => void
|
||||
}>("DownloadService")
|
||||
|
||||
/** Songs downloading at once while the app runs, as the queue defaults to. */
|
||||
const RUNNING_CONCURRENCY = 2
|
||||
|
||||
// Stopping right after starting can beat the service to `startForeground`,
|
||||
// which Android treats as a crash.
|
||||
const STOP_DELAY_MS = 2000
|
||||
|
||||
// Must match `identifierPrefixes` in app.config.ts.
|
||||
const TASK_PREFIX = `${Constants.expoConfig?.ios?.bundleIdentifier}.downloads`
|
||||
|
||||
function songsLeft(count: number) {
|
||||
return count === 1 ? "1 song left" : `${count} songs left`
|
||||
}
|
||||
|
||||
/**
|
||||
* Keeps downloads going while the app is in the background. Call the returned
|
||||
* function right after the person starts a download.
|
||||
*
|
||||
* iOS 26+: a continued processing task keeps the app running, with progress
|
||||
* in a Live Activity, so songs keep downloading a few at a time with fresh
|
||||
* sign-in tokens. It must start from the person's action, so it covers
|
||||
* downloads they start, not playlist syncs.
|
||||
*
|
||||
* iOS otherwise (and once that task ends): songs download in a background URL
|
||||
* session. Songs started while suspended may wait for Wi-Fi and power, so
|
||||
* every waiting song is handed over as the app leaves the screen.
|
||||
*
|
||||
* Android: a foreground service keeps the app running while songs are queued.
|
||||
*/
|
||||
export function useBackgroundDownloads(queue: DownloadQueue | null) {
|
||||
const startTask = useRef<() => void>(() => {})
|
||||
|
||||
useEffect(() => {
|
||||
if (!queue) return
|
||||
|
||||
if (Platform.OS === "ios") {
|
||||
let active = AppState.currentState === "active"
|
||||
let task: ContinuedTask | null = null
|
||||
let submitting = false
|
||||
let total = 0
|
||||
let lastPending = 0
|
||||
|
||||
const updateConcurrency = () =>
|
||||
queue.setConcurrency(
|
||||
active || task?.state === "running" ? RUNNING_CONCURRENCY : Infinity
|
||||
)
|
||||
|
||||
const end = () => {
|
||||
task = null
|
||||
setKeptRunning(false)
|
||||
updateConcurrency()
|
||||
}
|
||||
|
||||
const report = () => {
|
||||
const pending = queue.pendingCount()
|
||||
if (pending > lastPending) total += pending - lastPending
|
||||
lastPending = pending
|
||||
if (task?.state !== "running") return
|
||||
if (pending === 0) {
|
||||
task.complete(true)
|
||||
end()
|
||||
return
|
||||
}
|
||||
task.setProgress(total - pending, total)
|
||||
task.updateTitle("Downloading", songsLeft(pending))
|
||||
}
|
||||
|
||||
startTask.current = () => {
|
||||
if (!ContinuedTasks.isSupported || task || submitting) return
|
||||
const pending = queue.pendingCount()
|
||||
if (pending === 0) return
|
||||
submitting = true
|
||||
total = pending
|
||||
lastPending = pending
|
||||
ContinuedTasks.submit({
|
||||
identifierPrefix: TASK_PREFIX,
|
||||
title: "Downloading",
|
||||
subtitle: songsLeft(pending),
|
||||
totalUnitCount: total,
|
||||
// A task that cannot start now is no use once the app is closed.
|
||||
ios: { submissionStrategy: "fail" },
|
||||
})
|
||||
.then((submitted) => {
|
||||
task = submitted
|
||||
submitted.addOnStartListener(() => {
|
||||
setKeptRunning(true)
|
||||
updateConcurrency()
|
||||
report()
|
||||
})
|
||||
// iOS reports a cancel from the Live Activity as expiry too, so
|
||||
// either way the songs carry on in the background session.
|
||||
submitted.addOnStopListener(() => {
|
||||
if (task === submitted) end()
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
// Not permitted or unavailable: the background session covers it.
|
||||
})
|
||||
.finally(() => {
|
||||
submitting = false
|
||||
})
|
||||
}
|
||||
|
||||
updateConcurrency()
|
||||
const unsubscribe = queue.subscribe(report)
|
||||
const subscription = AppState.addEventListener("change", (state) => {
|
||||
active = state === "active"
|
||||
updateConcurrency()
|
||||
})
|
||||
return () => {
|
||||
startTask.current = () => {}
|
||||
unsubscribe()
|
||||
subscription.remove()
|
||||
task?.cancel()
|
||||
end()
|
||||
}
|
||||
}
|
||||
|
||||
if (!downloadService) return
|
||||
const service = downloadService
|
||||
let shown = 0
|
||||
let stopTimer: ReturnType<typeof setTimeout> | null = null
|
||||
const update = () => {
|
||||
const remaining = queue.pendingCount()
|
||||
if (remaining === shown) return
|
||||
if (stopTimer) clearTimeout(stopTimer)
|
||||
stopTimer = null
|
||||
if (remaining > 0) {
|
||||
shown = remaining
|
||||
service.update(remaining)
|
||||
} else {
|
||||
stopTimer = setTimeout(() => {
|
||||
shown = 0
|
||||
service.update(0)
|
||||
}, STOP_DELAY_MS)
|
||||
}
|
||||
}
|
||||
update()
|
||||
const unsubscribe = queue.subscribe(update)
|
||||
return () => {
|
||||
unsubscribe()
|
||||
if (stopTimer) clearTimeout(stopTimer)
|
||||
service.update(0)
|
||||
}
|
||||
}, [queue])
|
||||
|
||||
return useCallback(() => startTask.current(), [])
|
||||
}
|
||||
@@ -1,18 +1,5 @@
|
||||
import { File } from "expo-file-system"
|
||||
import {
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
useSyncExternalStore,
|
||||
} from "react"
|
||||
import {
|
||||
cancelAnimation,
|
||||
Easing,
|
||||
useSharedValue,
|
||||
withSequence,
|
||||
withTiming,
|
||||
} from "react-native-reanimated"
|
||||
import { useEffect, useMemo, useState, useSyncExternalStore } from "react"
|
||||
|
||||
import { api } from "@otunes/convex/_generated/api"
|
||||
import type { Id } from "@otunes/convex/_generated/dataModel"
|
||||
@@ -120,39 +107,3 @@ export function useLyricsTime(
|
||||
? advanced.time
|
||||
: currentTime
|
||||
}
|
||||
|
||||
/** How far the clock may drift from the player before it is reset. */
|
||||
const CLOCK_DRIFT_SECONDS = 0.15
|
||||
/** How far ahead the clock runs on its own; progress updates come long before. */
|
||||
const CLOCK_RUN_SECONDS = 3600
|
||||
|
||||
/**
|
||||
* Playback time in seconds on the UI thread, running smoothly between the
|
||||
* player's progress updates. It is reset only when it drifts, so animations
|
||||
* driven by it never restart mid-word.
|
||||
*/
|
||||
export function usePlaybackClock(currentTime: number, isPlaying: boolean) {
|
||||
const clock = useSharedValue(currentTime)
|
||||
const running = useRef(false)
|
||||
|
||||
useEffect(() => {
|
||||
if (!isPlaying) {
|
||||
running.current = false
|
||||
cancelAnimation(clock)
|
||||
clock.value = currentTime
|
||||
return
|
||||
}
|
||||
const drift = Math.abs(clock.value - currentTime)
|
||||
if (running.current && drift < CLOCK_DRIFT_SECONDS) return
|
||||
running.current = true
|
||||
clock.value = withSequence(
|
||||
withTiming(currentTime, { duration: 0 }),
|
||||
withTiming(currentTime + CLOCK_RUN_SECONDS, {
|
||||
duration: CLOCK_RUN_SECONDS * 1000,
|
||||
easing: Easing.linear,
|
||||
})
|
||||
)
|
||||
}, [clock, currentTime, isPlaying])
|
||||
|
||||
return clock
|
||||
}
|
||||
@@ -16,16 +16,9 @@ function authCookieNames(serverUrl: string) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Cookies that sign a request to the server in. Pass `refresh: false` for
|
||||
* requests that may run after the JWT expires (iOS background downloads): the
|
||||
* server would spend the refresh token, and the app's next refresh of the same
|
||||
* token would then end the session.
|
||||
*/
|
||||
export async function getAuthCookieHeader(
|
||||
serverUrl: string,
|
||||
convexUrl: string,
|
||||
{ refresh = true }: { refresh?: boolean } = {}
|
||||
convexUrl: string
|
||||
): Promise<string | null> {
|
||||
const [jwt, refreshToken] = await Promise.all([
|
||||
secureGetItem(authStorageKey(JWT_STORAGE_KEY, convexUrl)),
|
||||
@@ -38,7 +31,7 @@ export async function getAuthCookieHeader(
|
||||
|
||||
const names = authCookieNames(serverUrl)
|
||||
const parts = [`${names.jwt}=${jwt}`]
|
||||
if (refresh && refreshToken) {
|
||||
if (refreshToken) {
|
||||
parts.push(`${names.refresh}=${refreshToken}`)
|
||||
}
|
||||
|
||||
|
||||
@@ -12,28 +12,19 @@ const secureStoreOptions: SecureStore.SecureStoreOptions = {
|
||||
keychainAccessible: SecureStore.AFTER_FIRST_UNLOCK,
|
||||
}
|
||||
|
||||
// The last value read or written per key, for when the keychain refuses a
|
||||
// read (say, while the phone is locked and downloads continue).
|
||||
const remembered = new Map<string, string>()
|
||||
|
||||
export async function secureGetItem(key: string): Promise<string | null> {
|
||||
try {
|
||||
const value = await SecureStore.getItemAsync(key, secureStoreOptions)
|
||||
if (value === null) remembered.delete(key)
|
||||
else remembered.set(key, value)
|
||||
return value
|
||||
return await SecureStore.getItemAsync(key, secureStoreOptions)
|
||||
} catch {
|
||||
return remembered.get(key) ?? null
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
export async function secureSetItem(key: string, value: string): Promise<void> {
|
||||
remembered.set(key, value)
|
||||
await SecureStore.setItemAsync(key, value, secureStoreOptions)
|
||||
}
|
||||
|
||||
export async function secureRemoveItem(key: string): Promise<void> {
|
||||
remembered.delete(key)
|
||||
try {
|
||||
await SecureStore.deleteItemAsync(key, secureStoreOptions)
|
||||
} catch {
|
||||
|
||||
+12
-100
@@ -1,5 +1,5 @@
|
||||
import AsyncStorage from "@react-native-async-storage/async-storage"
|
||||
import { Directory, DownloadTask, File, Paths } from "expo-file-system"
|
||||
import { Directory, File, Paths } from "expo-file-system"
|
||||
import { Platform } from "react-native"
|
||||
|
||||
import {
|
||||
@@ -16,7 +16,6 @@ import {
|
||||
type DownloadQuality,
|
||||
} from "@otunes/convex/download-quality"
|
||||
import { getAuthCookieHeader } from "@/lib/auth-cookies"
|
||||
import { downloadQualitySupported } from "@/lib/playback-capabilities"
|
||||
import type { ServerConfig } from "@/lib/server-config"
|
||||
|
||||
const REMEMBERED_QUALITY_KEY = "otunes.download-quality"
|
||||
@@ -74,82 +73,6 @@ function audioFile(folder: Directory) {
|
||||
return folder.list().find((entry): entry is File => entry instanceof File)
|
||||
}
|
||||
|
||||
type SongDownload = {
|
||||
url: string
|
||||
destination: Directory
|
||||
headers: Record<string, string>
|
||||
signal: AbortSignal
|
||||
/** Checks and keeps the downloaded file, returning its size. */
|
||||
finish: (file: File) => number
|
||||
}
|
||||
|
||||
// Whether a continued processing task keeps the app running in the
|
||||
// background (iOS 26+, see `useBackgroundDownloads`).
|
||||
let keptRunning = false
|
||||
const regularSessionDownloads = new Set<() => void>()
|
||||
|
||||
/**
|
||||
* While a continued task keeps the app running, songs download through the
|
||||
* regular session: iOS treats background session downloads started from the
|
||||
* background as deferrable until Wi-Fi and power. When the task ends, running
|
||||
* songs restart in the background session before iOS suspends the app.
|
||||
*/
|
||||
export function setKeptRunning(running: boolean) {
|
||||
keptRunning = running
|
||||
if (!running) for (const handOff of regularSessionDownloads) handOff()
|
||||
}
|
||||
|
||||
/**
|
||||
* Downloads through an iOS URL session. The background one keeps going while
|
||||
* the app is suspended and wakes it when done; iOS keeps the app awake until
|
||||
* `finish` returns (up to 25 seconds). Downloads still running when iOS
|
||||
* terminates the app are lost.
|
||||
*/
|
||||
async function runDownloadTask(
|
||||
{ url, destination, headers, signal, finish }: SongDownload,
|
||||
sessionType: "foreground" | "background"
|
||||
) {
|
||||
const task = new DownloadTask(url, destination, {
|
||||
headers,
|
||||
signal,
|
||||
sessionType,
|
||||
deferBackgroundSessionCompletion: sessionType === "background",
|
||||
})
|
||||
const handOff = () => task.cancel()
|
||||
if (sessionType === "foreground") regularSessionDownloads.add(handOff)
|
||||
try {
|
||||
const file = await task.downloadAsync()
|
||||
if (!file) throw new Error("Download paused")
|
||||
return finish(file)
|
||||
} finally {
|
||||
regularSessionDownloads.delete(handOff)
|
||||
if (task.state === "completed") {
|
||||
await task.acknowledgeBackgroundCompletionAsync().catch(() => {})
|
||||
}
|
||||
task.release()
|
||||
}
|
||||
}
|
||||
|
||||
async function downloadOnIOS(download: SongDownload) {
|
||||
if (keptRunning) {
|
||||
try {
|
||||
return await runDownloadTask(download, "foreground")
|
||||
} catch (error) {
|
||||
// Still running means a real failure; otherwise it was handed off.
|
||||
if (keptRunning || download.signal.aborted) throw error
|
||||
}
|
||||
}
|
||||
return runDownloadTask(download, "background")
|
||||
}
|
||||
|
||||
/** Android keeps the app running with a foreground service instead. */
|
||||
async function downloadInForeground(download: SongDownload) {
|
||||
const { url, destination, headers, signal, finish } = download
|
||||
return finish(
|
||||
await File.downloadFileAsync(url, destination, { headers, signal })
|
||||
)
|
||||
}
|
||||
|
||||
function createStorage(config: ServerConfig): DownloadStorage {
|
||||
const root = serverDirectory(config)
|
||||
const indexFile = new File(root, "index.json")
|
||||
@@ -193,8 +116,7 @@ function createStorage(config: ServerConfig): DownloadStorage {
|
||||
async save({ songId, requested, quality, albumId }, signal) {
|
||||
const cookieHeader = await getAuthCookieHeader(
|
||||
config.serverUrl,
|
||||
config.convexUrl,
|
||||
{ refresh: Platform.OS !== "ios" }
|
||||
config.convexUrl
|
||||
)
|
||||
if (!cookieHeader) throw new Error("Sign in to download")
|
||||
|
||||
@@ -204,26 +126,17 @@ function createStorage(config: ServerConfig): DownloadStorage {
|
||||
if (partial.exists) partial.delete()
|
||||
partial.create()
|
||||
try {
|
||||
const url = `${config.serverUrl}${songDownloadPath(songId, requested, {
|
||||
const path = songDownloadPath(songId, requested, {
|
||||
losslessFormat: Platform.OS === "ios" ? "alac" : undefined,
|
||||
})}`
|
||||
const download =
|
||||
Platform.OS === "ios" ? downloadOnIOS : downloadInForeground
|
||||
return await download({
|
||||
url,
|
||||
destination: partial,
|
||||
headers: { Cookie: cookieHeader },
|
||||
signal,
|
||||
finish(file) {
|
||||
signal.throwIfAborted()
|
||||
// A lapsed sign-in redirects to the sign-in page instead of failing.
|
||||
if (file.extension === ".html") {
|
||||
throw new Error("Sign in to download")
|
||||
}
|
||||
partial.rename(name)
|
||||
return file.size ?? 0
|
||||
},
|
||||
})
|
||||
const file = await File.downloadFileAsync(
|
||||
`${config.serverUrl}${path}`,
|
||||
partial,
|
||||
{ headers: { Cookie: cookieHeader }, signal }
|
||||
)
|
||||
signal.throwIfAborted()
|
||||
partial.rename(name)
|
||||
return file.size ?? 0
|
||||
} catch (error) {
|
||||
if (partial.exists) partial.delete()
|
||||
throw error
|
||||
@@ -299,10 +212,9 @@ export function downloadedCoverUri(url: string) {
|
||||
|
||||
export async function readRememberedDownloadQuality() {
|
||||
try {
|
||||
const quality = parseDownloadQuality(
|
||||
return parseDownloadQuality(
|
||||
await AsyncStorage.getItem(REMEMBERED_QUALITY_KEY)
|
||||
)
|
||||
return quality && downloadQualitySupported(quality) ? quality : undefined
|
||||
} catch {
|
||||
return undefined
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ export type NowPlayingColors = {
|
||||
selected: string
|
||||
selectedForeground: string
|
||||
highlight: string
|
||||
/** Lyrics lines other than the one playing. */
|
||||
lyricsInactive: string
|
||||
/** Words of the playing line not yet sung. */
|
||||
lyricsUnsung: string
|
||||
isDark: boolean
|
||||
@@ -30,6 +32,7 @@ export function nowPlayingColors(palette: CoverPalette): NowPlayingColors {
|
||||
selected: withAlpha(foreground, 0.8),
|
||||
selectedForeground: palette.background,
|
||||
highlight: withAlpha(foreground, 0.1),
|
||||
lyricsInactive: withAlpha(foreground, 0.35),
|
||||
lyricsUnsung: withAlpha(foreground, 0.55),
|
||||
isDark: palette.isDark,
|
||||
}
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import { Platform } from "react-native"
|
||||
|
||||
import {
|
||||
DOWNLOAD_QUALITIES,
|
||||
type DownloadQuality,
|
||||
} from "@otunes/convex/download-quality"
|
||||
|
||||
// Android Dolby decoder reports do not reliably indicate working Atmos playback.
|
||||
export const dolbyAtmosSupported = Platform.OS === "ios"
|
||||
|
||||
@@ -12,13 +7,3 @@ export const dolbyAtmosSupported = Platform.OS === "ios"
|
||||
export function atmosEnabled(user: { preferAtmos?: boolean }) {
|
||||
return dolbyAtmosSupported && (user.preferAtmos ?? false)
|
||||
}
|
||||
|
||||
/** Whether this device may download in a quality. Android cannot download Atmos. */
|
||||
export function downloadQualitySupported(quality: DownloadQuality) {
|
||||
return quality !== "atmos" || dolbyAtmosSupported
|
||||
}
|
||||
|
||||
/** Download qualities this device offers, lowest first. */
|
||||
export const deviceDownloadQualities = DOWNLOAD_QUALITIES.filter(
|
||||
downloadQualitySupported
|
||||
)
|
||||
@@ -1,11 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'expo-module-gradle-plugin'
|
||||
}
|
||||
|
||||
group = 'expo.modules.downloadservice'
|
||||
version = '1.0.0'
|
||||
|
||||
android {
|
||||
namespace 'expo.modules.downloadservice'
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
|
||||
|
||||
<application>
|
||||
<service
|
||||
android:name="expo.modules.downloadservice.DownloadService"
|
||||
android:exported="false"
|
||||
android:foregroundServiceType="dataSync" />
|
||||
</application>
|
||||
</manifest>
|
||||
-88
@@ -1,88 +0,0 @@
|
||||
package expo.modules.downloadservice
|
||||
|
||||
import android.app.Notification
|
||||
import android.app.NotificationChannel
|
||||
import android.app.NotificationManager
|
||||
import android.app.PendingIntent
|
||||
import android.app.Service
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.ServiceInfo
|
||||
import android.os.Build
|
||||
import android.os.IBinder
|
||||
|
||||
/**
|
||||
* Keeps the app running while songs download, so Android does not freeze the
|
||||
* JS downloads when the app leaves the screen. Started with the number of
|
||||
* songs left, and stopped by the module once none are.
|
||||
*/
|
||||
class DownloadService : Service() {
|
||||
override fun onBind(intent: Intent?): IBinder? = null
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
val remaining = intent?.getIntExtra(EXTRA_REMAINING, 0) ?: 0
|
||||
val notification = notification(remaining)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
startForeground(NOTIFICATION_ID, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC)
|
||||
} else {
|
||||
startForeground(NOTIFICATION_ID, notification)
|
||||
}
|
||||
// A restarted service would have no downloads to keep alive.
|
||||
return START_NOT_STICKY
|
||||
}
|
||||
|
||||
// Android 15 limits data sync services to six hours a day.
|
||||
override fun onTimeout(startId: Int, fgsType: Int) {
|
||||
stopSelf()
|
||||
}
|
||||
|
||||
private fun notification(remaining: Int): Notification {
|
||||
val manager = getSystemService(NotificationManager::class.java)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
manager.createNotificationChannel(
|
||||
NotificationChannel(CHANNEL_ID, "Downloads", NotificationManager.IMPORTANCE_LOW)
|
||||
)
|
||||
}
|
||||
val builder = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
Notification.Builder(this, CHANNEL_ID)
|
||||
} else {
|
||||
@Suppress("DEPRECATION")
|
||||
Notification.Builder(this)
|
||||
}
|
||||
val launch = packageManager.getLaunchIntentForPackage(packageName)?.let {
|
||||
PendingIntent.getActivity(this, 0, it, PendingIntent.FLAG_IMMUTABLE)
|
||||
}
|
||||
return builder
|
||||
.setSmallIcon(android.R.drawable.stat_sys_download)
|
||||
.setContentTitle(if (remaining == 1) "Downloading 1 song" else "Downloading $remaining songs")
|
||||
.setContentIntent(launch)
|
||||
.setOngoing(true)
|
||||
.setOnlyAlertOnce(true)
|
||||
.build()
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val CHANNEL_ID = "downloads"
|
||||
private const val NOTIFICATION_ID = 7301
|
||||
private const val EXTRA_REMAINING = "remaining"
|
||||
|
||||
fun update(context: Context, remaining: Int) {
|
||||
val intent = Intent(context, DownloadService::class.java)
|
||||
if (remaining == 0) {
|
||||
context.stopService(intent)
|
||||
return
|
||||
}
|
||||
intent.putExtra(EXTRA_REMAINING, remaining)
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
context.startForegroundService(intent)
|
||||
} else {
|
||||
context.startService(intent)
|
||||
}
|
||||
} catch (_: IllegalStateException) {
|
||||
// Android 12+ refuses to start one from the background (say, a
|
||||
// playlist syncing); downloads then run only while the app does.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
package expo.modules.downloadservice
|
||||
|
||||
import expo.modules.kotlin.modules.Module
|
||||
import expo.modules.kotlin.modules.ModuleDefinition
|
||||
|
||||
class DownloadServiceModule : Module() {
|
||||
override fun definition() = ModuleDefinition {
|
||||
Name("DownloadService")
|
||||
|
||||
/** Shows how many songs are left, or stops the service at zero. */
|
||||
Function("update") { remaining: Int ->
|
||||
DownloadService.update(requireNotNull(appContext.reactContext), remaining)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"platforms": ["android"],
|
||||
"android": {
|
||||
"modules": ["expo.modules.downloadservice.DownloadServiceModule"]
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"name": "otunes-download-service",
|
||||
"version": "1.0.0",
|
||||
"private": true
|
||||
}
|
||||
@@ -20,7 +20,6 @@
|
||||
"@otunes/convex": "workspace:*",
|
||||
"@react-native-async-storage/async-storage": "2.2.0",
|
||||
"@react-native-community/slider": "5.2.1",
|
||||
"@react-native-masked-view/masked-view": "0.3.2",
|
||||
"@react-native/metro-config": "0.88.0",
|
||||
"convex": "^1.40.0",
|
||||
"expo": "~58.0.17",
|
||||
@@ -49,10 +48,8 @@
|
||||
"react": "19.3.0",
|
||||
"react-dom": "19.3.0",
|
||||
"react-native": "0.88.0",
|
||||
"react-native-continued-task": "0.1.0",
|
||||
"react-native-gesture-handler": "~3.3.0",
|
||||
"react-native-image-colors": "^2.6.0",
|
||||
"react-native-nitro-modules": "0.37.2",
|
||||
"react-native-reanimated": "4.7.1",
|
||||
"react-native-safe-area-context": "~5.10.1",
|
||||
"react-native-screens": "4.30.0",
|
||||
|
||||
@@ -39,10 +39,9 @@ const ASK_EVERY_TIME = "ask"
|
||||
|
||||
/** Shades of the text color, darkest for the smallest files. */
|
||||
const QUALITY_OPACITY: Record<DownloadQuality, number> = {
|
||||
low: 0.2,
|
||||
medium: 0.35,
|
||||
high: 0.5,
|
||||
lossless: 0.75,
|
||||
medium: 0.25,
|
||||
high: 0.45,
|
||||
lossless: 0.7,
|
||||
atmos: 1,
|
||||
}
|
||||
|
||||
|
||||
@@ -125,9 +125,8 @@ function collectionKey({ kind, id }: CollectionRef) {
|
||||
*/
|
||||
export function createDownloadQueue(
|
||||
storage: DownloadStorage,
|
||||
options: { concurrency?: number } = {}
|
||||
{ concurrency = 2 }: { concurrency?: number } = {}
|
||||
) {
|
||||
let concurrency = options.concurrency ?? 2
|
||||
const downloaded = new Map<string, DownloadedSong>()
|
||||
const collections = new Map<string, DownloadedCollection>()
|
||||
const otherSongIds = new Set<string>()
|
||||
@@ -373,17 +372,6 @@ export function createDownloadQueue(
|
||||
collections: () => [...collections.values()],
|
||||
isQueued,
|
||||
status,
|
||||
/** Songs downloading or waiting to. */
|
||||
pendingCount: () => running.size + waiting.length,
|
||||
|
||||
/**
|
||||
* How many songs download at once. Raising it starts waiting songs now;
|
||||
* lowering it lets running songs finish.
|
||||
*/
|
||||
setConcurrency(limit: number) {
|
||||
concurrency = limit
|
||||
pump()
|
||||
},
|
||||
|
||||
/** Songs downloaded on their own, in the order they were added. */
|
||||
otherSongIds: () => [...otherSongIds],
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
/**
|
||||
* Typo-tolerant word matching, shared by library search, lyrics search and
|
||||
* in-list song filters.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Lowercase words without accents or apostrophes, so "Don't Stop Beyoncé"
|
||||
* gives ["dont", "stop", "beyonce"].
|
||||
*/
|
||||
export function searchWords(text: string): string[] {
|
||||
return (
|
||||
text
|
||||
.normalize("NFKD")
|
||||
.replace(/\p{M}/gu, "")
|
||||
.toLowerCase()
|
||||
.replace(/['’]/g, "")
|
||||
.match(/[\p{L}\p{N}]+/gu) ?? []
|
||||
)
|
||||
}
|
||||
|
||||
/** Typos a query word may hold. Short words get none, or they match too much. */
|
||||
function allowedTypos(term: string) {
|
||||
if (term.length < 4) return 0
|
||||
return term.length < 8 ? 1 : 2
|
||||
}
|
||||
|
||||
/**
|
||||
* Edits (insert, delete, substitute or swap neighbors) turning `a` into `b`,
|
||||
* or `max + 1` once it is sure to exceed `max`.
|
||||
*/
|
||||
function editDistance(a: string, b: string, max: number): number {
|
||||
if (Math.abs(a.length - b.length) > max) return max + 1
|
||||
let before: number[] = []
|
||||
let previous = Array.from({ length: b.length + 1 }, (_, j) => j)
|
||||
for (let i = 1; i <= a.length; i++) {
|
||||
const current = [i]
|
||||
let rowMin = i
|
||||
for (let j = 1; j <= b.length; j++) {
|
||||
const cost = a[i - 1] === b[j - 1] ? 0 : 1
|
||||
let distance = Math.min(
|
||||
previous[j]! + 1,
|
||||
current[j - 1]! + 1,
|
||||
previous[j - 1]! + cost
|
||||
)
|
||||
if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {
|
||||
distance = Math.min(distance, before[j - 2]! + 1)
|
||||
}
|
||||
current.push(distance)
|
||||
rowMin = Math.min(rowMin, distance)
|
||||
}
|
||||
if (rowMin > max) return max + 1
|
||||
before = previous
|
||||
previous = current
|
||||
}
|
||||
return previous[b.length]!
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether `word` is query `term` give or take a few typos. With `prefix` the
|
||||
* word may also just start with the term, as when it is still being typed.
|
||||
*/
|
||||
function wordMatchesTerm(term: string, word: string, prefix: boolean) {
|
||||
const typos = allowedTypos(term)
|
||||
if (typos === 0) return false
|
||||
if (editDistance(term, word, typos) <= typos) return true
|
||||
return (
|
||||
prefix &&
|
||||
word.length > term.length &&
|
||||
editDistance(term, word.slice(0, term.length), typos) <= typos
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* How every query term (from `searchWords`) appears among `words`: "exact"
|
||||
* when each is a word, "fuzzy" when some only match give or take typos, or
|
||||
* null when one is missing. The last term may be a word's prefix.
|
||||
*/
|
||||
export function matchWords(
|
||||
words: readonly string[],
|
||||
terms: readonly string[]
|
||||
): "exact" | "fuzzy" | null {
|
||||
let quality: "exact" | "fuzzy" = "exact"
|
||||
for (const [index, term] of terms.entries()) {
|
||||
const prefix = index === terms.length - 1
|
||||
const exact = words.some((word) =>
|
||||
prefix ? word.startsWith(term) : word === term
|
||||
)
|
||||
if (exact) continue
|
||||
if (!words.some((word) => wordMatchesTerm(term, word, prefix))) return null
|
||||
quality = "fuzzy"
|
||||
}
|
||||
return terms.length > 0 ? quality : null
|
||||
}
|
||||
@@ -5,8 +5,6 @@
|
||||
* the same.
|
||||
*/
|
||||
|
||||
import { matchWords, searchWords } from "./fuzzy-search"
|
||||
|
||||
export type LyricWord = {
|
||||
/** Includes its trailing space, so a line's words join back into its text. */
|
||||
text: string
|
||||
@@ -214,32 +212,32 @@ export function followLyrics(
|
||||
return () => clearTimeout(timer)
|
||||
}
|
||||
|
||||
/** Lowercase words of a search, for matching lyrics the way the search index does. */
|
||||
function searchTerms(query: string): string[] {
|
||||
return query.toLowerCase().match(/[\p{L}\p{N}']+/gu) ?? []
|
||||
}
|
||||
|
||||
const SNIPPET_LEAD = 24
|
||||
|
||||
export type LyricsMatch = {
|
||||
/** The matched line, trimmed to start near the match. */
|
||||
snippet: string
|
||||
/**
|
||||
* 2 when the line holds the query as typed, 1 when it holds every word of
|
||||
* it, 0 when it does give or take typos.
|
||||
*/
|
||||
score: 0 | 1 | 2
|
||||
/** Whether the line holds the query as typed, not just its words. */
|
||||
exact: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Where a search matched the lyrics: the best line holding the query as
|
||||
* typed, or else every word of it (see `matchWords`). Null when no single
|
||||
* line does.
|
||||
* Where a search matched the lyrics: a line holding the query as typed, or
|
||||
* else a line holding every word of it (the last may be a prefix, as when
|
||||
* typing). Null when no single line does.
|
||||
*/
|
||||
export function matchLyrics(plain: string, query: string): LyricsMatch | null {
|
||||
const needle = query.trim().toLowerCase()
|
||||
const terms = searchWords(needle)
|
||||
// Most songs miss a word entirely, so skip them before checking lines.
|
||||
if (!needle || !matchWords([...new Set(searchWords(plain))], terms)) {
|
||||
return null
|
||||
}
|
||||
const terms = searchTerms(needle)
|
||||
const last = terms.at(-1)
|
||||
if (!needle || last === undefined) return null
|
||||
|
||||
let loose: LyricsMatch | null = null
|
||||
let loose: string | null = null
|
||||
for (const line of plain.split("\n")) {
|
||||
const column = line.toLowerCase().indexOf(needle)
|
||||
if (column !== -1) {
|
||||
@@ -247,13 +245,15 @@ export function matchLyrics(plain: string, query: string): LyricsMatch | null {
|
||||
column > SNIPPET_LEAD
|
||||
? `…${line.slice(column - SNIPPET_LEAD).trimStart()}`
|
||||
: line.trim()
|
||||
return { snippet, score: 2 }
|
||||
return { snippet, exact: true }
|
||||
}
|
||||
if (loose?.score === 1) continue
|
||||
const quality = matchWords(searchWords(line), terms)
|
||||
if (quality === "exact" || (quality && !loose)) {
|
||||
loose = { snippet: line.trim(), score: quality === "exact" ? 1 : 0 }
|
||||
if (loose === null) {
|
||||
const words = searchTerms(line)
|
||||
const hasAll =
|
||||
terms.slice(0, -1).every((term) => words.includes(term)) &&
|
||||
words.some((word) => word.startsWith(last))
|
||||
if (hasAll) loose = line.trim()
|
||||
}
|
||||
}
|
||||
return loose
|
||||
return loose === null ? null : { snippet: loose, exact: false }
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
import { matchWords, searchWords } from "./fuzzy-search"
|
||||
|
||||
type SearchableSong = {
|
||||
id: string
|
||||
title: string
|
||||
@@ -8,9 +6,9 @@ type SearchableSong = {
|
||||
}
|
||||
|
||||
/**
|
||||
* Case-insensitive match on title, artist, or album, give or take typos (see
|
||||
* `matchWords`), plus the songs in `lyricsMatches` (from
|
||||
* `api.lyrics.matchingSongIds`). A blank query keeps every song.
|
||||
* Case-insensitive match on title, artist, or album, plus the songs in
|
||||
* `lyricsMatches` (from `api.lyrics.matchingSongIds`). A blank query keeps
|
||||
* every song.
|
||||
*/
|
||||
export function filterSongs<T extends SearchableSong>(
|
||||
songs: T[],
|
||||
@@ -21,14 +19,12 @@ export function filterSongs<T extends SearchableSong>(
|
||||
if (!normalized) {
|
||||
return songs
|
||||
}
|
||||
const terms = searchWords(normalized)
|
||||
const byLyrics = new Set(lyricsMatches)
|
||||
return songs.filter((song) => {
|
||||
if (byLyrics.has(song.id)) return true
|
||||
const fields = [song.title, song.artist.name, song.album.title]
|
||||
return (
|
||||
fields.some((value) => value.toLowerCase().includes(normalized)) ||
|
||||
matchWords(searchWords(fields.join(" ")), terms) !== null
|
||||
)
|
||||
})
|
||||
return songs.filter(
|
||||
(song) =>
|
||||
byLyrics.has(song.id) ||
|
||||
[song.title, song.artist.name, song.album.title].some((value) =>
|
||||
value.toLowerCase().includes(normalized)
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -27,7 +27,6 @@ import { chunk, type Chunked } from "./limits"
|
||||
import { recordIntentCatalogChanges } from "./intentCatalogChanges"
|
||||
import { playlistCoverVersion } from "./playlistCover"
|
||||
import { deleteSongLyrics, searchSongLyrics, writeSongLyrics } from "./lyrics"
|
||||
import { matchWords, searchWords } from "../client/fuzzy-search"
|
||||
|
||||
export type {
|
||||
BrowseAlbum,
|
||||
@@ -619,16 +618,7 @@ export const browseArtistDetail = query({
|
||||
},
|
||||
})
|
||||
|
||||
/**
|
||||
* How well `text` matches a lowercase search, from 100 (the whole text) down
|
||||
* to 20 (every word, give or take typos); 0 is no match. `terms` are the
|
||||
* query's `searchWords`.
|
||||
*/
|
||||
function matchScore(
|
||||
text: string,
|
||||
query: string,
|
||||
terms: readonly string[]
|
||||
): number {
|
||||
function matchScore(text: string, query: string): number {
|
||||
const lower = text.toLowerCase()
|
||||
if (lower === query) {
|
||||
return 100
|
||||
@@ -642,20 +632,15 @@ function matchScore(
|
||||
if (lower.includes(query)) {
|
||||
return 40
|
||||
}
|
||||
const words = matchWords(searchWords(text), terms)
|
||||
if (words === "exact") {
|
||||
return 30
|
||||
}
|
||||
return words === "fuzzy" ? 20 : 0
|
||||
return 0
|
||||
}
|
||||
|
||||
function matchScoreSongArtists(
|
||||
artist: string | string[],
|
||||
query: string,
|
||||
terms: readonly string[]
|
||||
query: string
|
||||
): number {
|
||||
return getSongArtistNames(artist).reduce(
|
||||
(best, name) => Math.max(best, matchScore(name, query, terms)),
|
||||
(best, name) => Math.max(best, matchScore(name, query)),
|
||||
0
|
||||
)
|
||||
}
|
||||
@@ -673,7 +658,6 @@ export const searchLibrary = query({
|
||||
args: { query: v.string() },
|
||||
handler: async (ctx, args) => {
|
||||
const queryText = args.query.trim().toLowerCase()
|
||||
const terms = searchWords(queryText)
|
||||
if (!queryText || !(await isSignedIn(ctx))) {
|
||||
return {
|
||||
topResults: [],
|
||||
@@ -694,7 +678,7 @@ export const searchLibrary = query({
|
||||
.map((artist) => ({
|
||||
kind: "artist" as const,
|
||||
item: toBrowseArtist(artist),
|
||||
score: matchScore(artist.name, queryText, terms),
|
||||
score: matchScore(artist.name, queryText),
|
||||
}))
|
||||
.filter((result) => result.score > 0)
|
||||
.sort(
|
||||
@@ -708,8 +692,8 @@ export const searchLibrary = query({
|
||||
return []
|
||||
}
|
||||
const score = Math.max(
|
||||
matchScore(album.name, queryText, terms),
|
||||
matchScore(artist.name, queryText, terms)
|
||||
matchScore(album.name, queryText),
|
||||
matchScore(artist.name, queryText)
|
||||
)
|
||||
if (score === 0) {
|
||||
return []
|
||||
@@ -734,10 +718,10 @@ export const searchLibrary = query({
|
||||
return []
|
||||
}
|
||||
const score = Math.max(
|
||||
matchScore(song.name, queryText, terms),
|
||||
matchScoreSongArtists(song.artist, queryText, terms),
|
||||
matchScore(album.name, queryText, terms),
|
||||
matchScore(albumArtist.name, queryText, terms)
|
||||
matchScore(song.name, queryText),
|
||||
matchScoreSongArtists(song.artist, queryText),
|
||||
matchScore(album.name, queryText),
|
||||
matchScore(albumArtist.name, queryText)
|
||||
)
|
||||
if (score === 0) {
|
||||
return []
|
||||
|
||||
@@ -62,10 +62,10 @@ export async function deleteSongLyrics(ctx: MutationCtx, songId: Id<"songs">) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Up to `limit` songs with a lyrics line matching `query` (see `matchLyrics`),
|
||||
* with that line, best matches first. The search index matches any word
|
||||
* anywhere in the lyrics and ranks common words poorly, so its whole page is
|
||||
* checked line by line before trimming.
|
||||
* Songs with a lyrics line matching `query` (see `matchLyrics`), with that
|
||||
* line. Lines holding the query as typed come first, then the search index's
|
||||
* relevance order. The index matches words anywhere in the lyrics, so its
|
||||
* results are checked line by line.
|
||||
*/
|
||||
export async function searchSongLyrics(
|
||||
ctx: QueryCtx,
|
||||
@@ -77,15 +77,15 @@ export async function searchSongLyrics(
|
||||
const rows = await ctx.db
|
||||
.query("lyricsSearch")
|
||||
.withSearchIndex("search_plain", (q) => q.search("plain", text))
|
||||
.take(MAX_LYRICS_MATCHES)
|
||||
return rows
|
||||
.flatMap((row) => {
|
||||
const match = matchLyrics(row.plain, text)
|
||||
return match ? [{ song: row.song, ...match }] : []
|
||||
})
|
||||
.sort((a, b) => b.score - a.score)
|
||||
.slice(0, limit)
|
||||
.map(({ song, snippet }) => ({ song, snippet }))
|
||||
.take(limit)
|
||||
const matches = rows.flatMap((row) => {
|
||||
const match = matchLyrics(row.plain, text)
|
||||
return match ? [{ song: row.song, ...match }] : []
|
||||
})
|
||||
return [
|
||||
...matches.filter((match) => match.exact),
|
||||
...matches.filter((match) => !match.exact),
|
||||
].map(({ song, snippet }) => ({ song, snippet }))
|
||||
}
|
||||
|
||||
/** The song's lyrics tag (see `client/lyrics.ts`), or null without lyrics. */
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { PlaybackSource, PlaybackStreamPlan } from "./playback-stream"
|
||||
|
||||
/** Qualities a listener can pick when downloading, lowest first. */
|
||||
export const DOWNLOAD_QUALITIES = [
|
||||
"low",
|
||||
"medium",
|
||||
"high",
|
||||
"lossless",
|
||||
@@ -12,7 +11,6 @@ export const DOWNLOAD_QUALITIES = [
|
||||
export type DownloadQuality = (typeof DOWNLOAD_QUALITIES)[number]
|
||||
|
||||
export const DOWNLOAD_QUALITY_LABELS: Record<DownloadQuality, string> = {
|
||||
low: "Low",
|
||||
medium: "Medium",
|
||||
high: "High",
|
||||
lossless: "Lossless",
|
||||
@@ -20,14 +18,12 @@ export const DOWNLOAD_QUALITY_LABELS: Record<DownloadQuality, string> = {
|
||||
}
|
||||
|
||||
export const DOWNLOAD_QUALITY_DETAILS: Record<DownloadQuality, string> = {
|
||||
low: "AAC 64 kbps",
|
||||
medium: "AAC 128 kbps",
|
||||
high: "AAC 256 kbps",
|
||||
lossless: "ALAC or FLAC",
|
||||
atmos: "Spatial audio",
|
||||
}
|
||||
|
||||
const LOW_KBPS = 64
|
||||
const MEDIUM_KBPS = 128
|
||||
const HIGH_KBPS = 256
|
||||
|
||||
@@ -58,14 +54,13 @@ function highPlan(files: Record<string, unknown>): DownloadPlan {
|
||||
|
||||
/**
|
||||
* Picks the file for one song. Lossless and Dolby Atmos fall back to High when
|
||||
* the song lacks them, and Low and Medium are always transcoded.
|
||||
* the song lacks them, and Medium is always transcoded.
|
||||
*/
|
||||
export function downloadPlan(
|
||||
files: Record<string, unknown>,
|
||||
quality: DownloadQuality
|
||||
): DownloadPlan {
|
||||
switch (quality) {
|
||||
case "low":
|
||||
case "medium":
|
||||
return {
|
||||
quality,
|
||||
@@ -75,7 +70,7 @@ export function downloadPlan(
|
||||
: "normal" in files
|
||||
? "normal"
|
||||
: "atmos",
|
||||
kbps: quality === "low" ? LOW_KBPS : MEDIUM_KBPS,
|
||||
kbps: MEDIUM_KBPS,
|
||||
}
|
||||
case "high":
|
||||
return highPlan(files)
|
||||
@@ -89,7 +84,7 @@ export function downloadPlan(
|
||||
|
||||
/**
|
||||
* The download quality holding the same audio a stream plan plays, so a
|
||||
* download can stand in for streaming.
|
||||
* download can stand in for streaming. Low has no download equivalent.
|
||||
*/
|
||||
export function streamDownloadQuality(
|
||||
plan: PlaybackStreamPlan
|
||||
@@ -100,7 +95,6 @@ export function streamDownloadQuality(
|
||||
}
|
||||
if (plan.kbps === HIGH_KBPS) return "high"
|
||||
if (plan.kbps === MEDIUM_KBPS) return "medium"
|
||||
if (plan.kbps === LOW_KBPS) return "low"
|
||||
return undefined
|
||||
}
|
||||
|
||||
@@ -135,7 +129,6 @@ export function downloadOptions(
|
||||
).length
|
||||
if (
|
||||
fallbackCount === songs.length &&
|
||||
quality !== "low" &&
|
||||
quality !== "medium" &&
|
||||
quality !== "high"
|
||||
) {
|
||||
|
||||
Generated
-43
@@ -279,9 +279,6 @@ importers:
|
||||
'@react-native-community/slider':
|
||||
specifier: 5.2.1
|
||||
version: 5.2.1(patch_hash=73deacaea9aae000a42050d343517da9e16e736e92a4fff3f61f81dba093a1c4)
|
||||
'@react-native-masked-view/masked-view':
|
||||
specifier: 0.3.2
|
||||
version: 0.3.2(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0)
|
||||
'@react-native/metro-config':
|
||||
specifier: 0.88.0
|
||||
version: 0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1)
|
||||
@@ -366,18 +363,12 @@ importers:
|
||||
react-native:
|
||||
specifier: 0.88.0
|
||||
version: 0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1)
|
||||
react-native-continued-task:
|
||||
specifier: 0.1.0
|
||||
version: 0.1.0(react-native-nitro-modules@0.37.2(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0))(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0)
|
||||
react-native-gesture-handler:
|
||||
specifier: ~3.3.0
|
||||
version: 3.3.0(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0)
|
||||
react-native-image-colors:
|
||||
specifier: ^2.6.0
|
||||
version: 2.6.0(expo@58.0.17)(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0)(supports-color@8.1.1)
|
||||
react-native-nitro-modules:
|
||||
specifier: 0.37.2
|
||||
version: 0.37.2(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0)
|
||||
react-native-reanimated:
|
||||
specifier: 4.7.1
|
||||
version: 4.7.1(patch_hash=badfed6babfff7fa495b3a06ba8f324be0e5ff82cedb6084f9f4d1dad65984d3)(react-native-worklets@0.13.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0)(supports-color@8.1.1))(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0)
|
||||
@@ -5447,9 +5438,6 @@ packages:
|
||||
sass:
|
||||
optional: true
|
||||
|
||||
nitro-core@0.37.2:
|
||||
resolution: {integrity: sha512-dhagikz9VXXzfidRH/vPNJfYWPmTBArDOo9wE/wEqeERU9C8uRWz9YccOyNUOvADccPAZq319yzhDMoJ9excSQ==}
|
||||
|
||||
node-exports-info@1.6.2:
|
||||
resolution: {integrity: sha512-kXs9Go0cah0qHVV2v389IXQLdLCeE1xfFtjOAF+iobu0OIoG1pje8At2vMHyaPMiPMnG/LWP50twML21eMcAag==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -5901,16 +5889,6 @@ packages:
|
||||
react-is@19.2.7:
|
||||
resolution: {integrity: sha512-kZFnouyVv7eP/Phmrlo9FK+zcAdriZJvzxXHF1Sl1P377WSGe2G/JxVolhTrB/jeV47lKImhNUsijjHAAbcl/A==}
|
||||
|
||||
react-native-continued-task@0.1.0:
|
||||
resolution: {integrity: sha512-6x9YesK++u6vraaReebWEKbcDjMeRInsQzd+uWXAbNiXasgZ2zulTextzK/zBZ2mBrCZqTZVK60eoPp07BF0MA==}
|
||||
peerDependencies:
|
||||
react: '*'
|
||||
react-native: '*'
|
||||
react-native-nitro-modules: '*'
|
||||
peerDependenciesMeta:
|
||||
react-native-nitro-modules:
|
||||
optional: true
|
||||
|
||||
react-native-drawer-layout@4.2.12:
|
||||
resolution: {integrity: sha512-qYmntEctkMSodN7pnC2llV21nswImLFPHJeT3PJXSJqZdU4jzDATR8iVi66sXkrtoOLJ2+EvXxgd7sMMpV4ViA==}
|
||||
peerDependencies:
|
||||
@@ -5938,12 +5916,6 @@ packages:
|
||||
react: '*'
|
||||
react-native: '*'
|
||||
|
||||
react-native-nitro-modules@0.37.2:
|
||||
resolution: {integrity: sha512-Odnrq/p6/q0R01qZlkqeXu9VHHMuGEnZZmyxMvehEu6QiACNHhBCmAHgyBDqOSo9Lb3G0TscFAT+HG0uxsR/GA==}
|
||||
peerDependencies:
|
||||
react: '*'
|
||||
react-native: '*'
|
||||
|
||||
react-native-reanimated@4.7.1:
|
||||
resolution: {integrity: sha512-HviDFSZ6V4KTRsrLS6hRbBJ4j63l/L8a5az0EoWdJwaMLYnBNyYISTDxwXpEYkMbAbLzCMCviIdiOxXHYQWcNA==}
|
||||
peerDependencies:
|
||||
@@ -12501,8 +12473,6 @@ snapshots:
|
||||
- '@types/node'
|
||||
- babel-plugin-macros
|
||||
|
||||
nitro-core@0.37.2: {}
|
||||
|
||||
node-exports-info@1.6.2:
|
||||
dependencies:
|
||||
array.prototype.flatmap: 1.3.3
|
||||
@@ -12966,13 +12936,6 @@ snapshots:
|
||||
|
||||
react-is@19.2.7: {}
|
||||
|
||||
react-native-continued-task@0.1.0(react-native-nitro-modules@0.37.2(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0))(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0):
|
||||
dependencies:
|
||||
react: 19.3.0
|
||||
react-native: 0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1)
|
||||
optionalDependencies:
|
||||
react-native-nitro-modules: 0.37.2(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0)
|
||||
|
||||
react-native-drawer-layout@4.2.12(309f9235979e0472ca5a2d24f8d225b6):
|
||||
dependencies:
|
||||
color: 4.2.3
|
||||
@@ -13004,12 +12967,6 @@ snapshots:
|
||||
react: 19.3.0
|
||||
react-native: 0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1)
|
||||
|
||||
react-native-nitro-modules@0.37.2(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0):
|
||||
dependencies:
|
||||
nitro-core: 0.37.2
|
||||
react: 19.3.0
|
||||
react-native: 0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1)
|
||||
|
||||
react-native-reanimated@4.7.1(patch_hash=badfed6babfff7fa495b3a06ba8f324be0e5ff82cedb6084f9f4d1dad65984d3)(react-native-worklets@0.13.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0)(supports-color@8.1.1))(react-native@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.0(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1))(@types/react@19.3.0)(react@19.3.0)(supports-color@8.1.1))(react@19.3.0):
|
||||
dependencies:
|
||||
react: 19.3.0
|
||||
|
||||
Reference in new issue
Block a user