mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 06:25:41 +00:00
feat: Nord themes, Wayland compatibility, and stability fixes (v1.0.6)
This commit is contained in:
@@ -74,6 +74,7 @@ interface PlayerState {
|
||||
}
|
||||
|
||||
let progressInterval: ReturnType<typeof setInterval> | null = null;
|
||||
let seekDebounce: ReturnType<typeof setTimeout> | null = null;
|
||||
|
||||
function clearProgress() {
|
||||
if (progressInterval) {
|
||||
@@ -243,8 +244,15 @@ export const usePlayerStore = create<PlayerState>()(
|
||||
const { howl, currentTrack } = get();
|
||||
if (!howl || !currentTrack) return;
|
||||
const time = progress * (howl.duration() || currentTrack.duration);
|
||||
howl.seek(time);
|
||||
// Update UI immediately for responsiveness
|
||||
set({ progress, currentTime: time });
|
||||
// Debounce the actual seek — GStreamer on Linux stalls if two seeks arrive
|
||||
// before the first one completes (reproducible after the 2nd seek)
|
||||
if (seekDebounce) clearTimeout(seekDebounce);
|
||||
seekDebounce = setTimeout(() => {
|
||||
get().howl?.seek(time);
|
||||
seekDebounce = null;
|
||||
}, 100);
|
||||
},
|
||||
|
||||
setVolume: (v) => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { create } from 'zustand';
|
||||
import { persist } from 'zustand/middleware';
|
||||
|
||||
type Theme = 'mocha' | 'latte';
|
||||
type Theme = 'mocha' | 'macchiato' | 'frappe' | 'latte' | 'nord' | 'nord-snowstorm' | 'nord-frost' | 'nord-aurora';
|
||||
|
||||
interface ThemeState {
|
||||
theme: Theme;
|
||||
|
||||
Reference in New Issue
Block a user