port desktop's search engine

This commit is contained in:
Boof2015
2026-06-28 09:46:08 -04:00
parent 3ec3f5ecf2
commit dcdddb350d
19 changed files with 2944 additions and 223 deletions
+17
View File
@@ -16,12 +16,15 @@ import {
JetBrainsMono_500Medium,
} from '@expo-google-fonts/jetbrains-mono';
import { usePlaybackSync } from '@/audio/usePlaybackSync';
import { QuickSearchOverlay } from '@/components/search/QuickSearchOverlay';
import { useScopeLifecycle } from '@/scope/useScopeLifecycle';
import { useLibraryStore } from '@/stores/libraryStore';
import { useEQStore } from '@/stores/eqStore';
import { useAudioSettingsStore } from '@/stores/audioSettingsStore';
import { useRemoteSourcesStore } from '@/stores/remoteSourcesStore';
import { useLastFmSettingsStore } from '@/stores/lastFmSettingsStore';
import { useNormalizationSync } from '@/audio/useNormalizationSync';
import { useLastFmScrobbler } from '@/audio/useLastFmScrobbler';
import { colors } from '@/theme';
SplashScreen.preventAutoHideAsync();
@@ -44,6 +47,12 @@ function NormalizationSync() {
return null;
}
/** Feeds playback snapshots to the Last.fm scrobble service. Renders nothing. */
function LastFmScrobbler() {
useLastFmScrobbler();
return null;
}
export default function RootLayout() {
const [fontsLoaded] = useFonts({
Inter_400Regular,
@@ -82,6 +91,12 @@ export default function RootLayout() {
.getState()
.init()
.catch((err) => console.error('[remoteSources] init failed', err));
// Last.fm: construct the scrobble service + drain any persisted offline queue,
// even if the user never opens the settings screen this session.
useLastFmSettingsStore
.getState()
.init()
.catch((err) => console.error('[lastfm] init failed', err));
}, []);
if (!fontsLoaded) return null;
@@ -93,6 +108,7 @@ export default function RootLayout() {
<PlaybackSync />
<ScopeLifecycle />
<NormalizationSync />
<LastFmScrobbler />
<Stack
screenOptions={{
headerShown: false,
@@ -110,6 +126,7 @@ export default function RootLayout() {
}}
/>
</Stack>
<QuickSearchOverlay />
</SafeAreaProvider>
</GestureHandlerRootView>
);