mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-02 10:53:33 +00:00
Add files
This commit is contained in:
commit
e87c814068
266 changed files with 63938 additions and 0 deletions
23
src/renderer/features/player/hooks/use-scrobble.ts
Normal file
23
src/renderer/features/player/hooks/use-scrobble.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { useState } from 'react';
|
||||
import { usePlayerStore } from '/@/renderer/store';
|
||||
|
||||
export const useScrobble = () => {
|
||||
const [isScrobbled, setIsScrobbled] = useState(false);
|
||||
|
||||
const currentSongDuration = usePlayerStore((state) => state.current.song?.duration);
|
||||
|
||||
const scrobbleAtPercentage = usePlayerStore((state) => state.settings.scrobbleAtPercentage);
|
||||
|
||||
console.log('currentSongDuration', currentSongDuration);
|
||||
|
||||
const scrobbleAtTime = (currentSongDuration * scrobbleAtPercentage) / 100;
|
||||
|
||||
console.log('scrobbleAtTime', scrobbleAtTime);
|
||||
|
||||
console.log('render');
|
||||
const handleScrobble = () => {
|
||||
console.log('scrobble complete');
|
||||
};
|
||||
|
||||
return { handleScrobble, isScrobbled, setIsScrobbled };
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue