feat: naive scrobbling integration

This commit is contained in:
Lei Nelissen
2023-04-27 15:08:10 +02:00
parent fb4d3932e5
commit 0bf2775c93
10 changed files with 176 additions and 9 deletions

View File

@@ -30,9 +30,12 @@ const DarkTheme = {
}
};
// Track whether the player has already been setup, so that we don't
// accidentally do it twice.
let hasSetupPlayer = false;
export default function App(): JSX.Element {
const colorScheme = useColorScheme();
// const colorScheme = 'dark';
const theme = themes[colorScheme || 'light'];
useEffect(() => {
@@ -47,9 +50,14 @@ export default function App(): JSX.Element {
Capability.Stop,
Capability.SeekTo,
],
progressUpdateEventInterval: 5,
});
}
setupTrackPlayer();
if (!hasSetupPlayer) {
setupTrackPlayer();
hasSetupPlayer = true;
}
}, []);
return (