Create Kaleido Desktop, a cinematic Plex client for Windows
Tauri 2 shell with a React/TypeScript interface and libmpv playback composed beneath the web view (DirectComposition on Windows). Shared code with per-OS platform modules and configs so macOS and Linux can follow. - Plex sign-in (browser, plex.tv/link or manual), server selection, Plex Home - Home, Movies and TV Shows (Discover, Library, Collections), search, people - Title pages with logos, ratings, cast, extras, seasons and episodes - Direct play with Plex conversion fallback, tracks, markers, autoplay - Metadata editing, artwork, fix match, refresh, analyze and deletion - Resumable offline downloads - App settings and Plex server administration with a live dashboard - Signed updater feed and Forgejo CI Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
00d72e70f4
121 changed files with 25315 additions and 0 deletions
102
src/app/settings.ts
Normal file
102
src/app/settings.ts
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
import { create } from 'zustand';
|
||||
import { persist } from 'zustand/middleware';
|
||||
|
||||
export type Quality = 'original' | '2160' | '1080' | '720' | '480';
|
||||
export type SkipMode = 'off' | 'button' | 'auto';
|
||||
export type SubtitleMode = 'auto' | 'always' | 'forced' | 'off';
|
||||
|
||||
export interface Preferences {
|
||||
// Playback
|
||||
quality: Quality;
|
||||
remoteQuality: Quality;
|
||||
hwdec: boolean;
|
||||
hdrPassthrough: boolean;
|
||||
autoplayNext: boolean;
|
||||
countdownSeconds: number;
|
||||
skipIntro: SkipMode;
|
||||
skipCredits: SkipMode;
|
||||
watchedPercent: number;
|
||||
audioLanguage: string;
|
||||
subtitleMode: SubtitleMode;
|
||||
subtitleLanguage: string;
|
||||
subtitleScale: number;
|
||||
subtitleBackground: boolean;
|
||||
volume: number;
|
||||
seekStep: number;
|
||||
// Interface
|
||||
startPage: 'home' | 'movies' | 'shows';
|
||||
colorWash: boolean;
|
||||
reducedMotion: boolean;
|
||||
posterSize: 'compact' | 'comfortable' | 'large';
|
||||
heroRotation: boolean;
|
||||
themeMusic: boolean;
|
||||
themeVolume: number;
|
||||
// Libraries shown for Movies and TV Shows
|
||||
movieSection: string;
|
||||
showSection: string;
|
||||
// Downloads
|
||||
downloadDir: string;
|
||||
// Remembered library views per section
|
||||
libraryViews: Record<string, { sort: string; filters: Record<string, string> }>;
|
||||
}
|
||||
|
||||
export const defaults: Preferences = {
|
||||
quality: 'original',
|
||||
remoteQuality: '1080',
|
||||
hwdec: true,
|
||||
hdrPassthrough: true,
|
||||
autoplayNext: true,
|
||||
countdownSeconds: 8,
|
||||
skipIntro: 'button',
|
||||
skipCredits: 'button',
|
||||
watchedPercent: 90,
|
||||
audioLanguage: '',
|
||||
subtitleMode: 'auto',
|
||||
subtitleLanguage: '',
|
||||
subtitleScale: 1,
|
||||
subtitleBackground: false,
|
||||
volume: 100,
|
||||
seekStep: 10,
|
||||
startPage: 'home',
|
||||
colorWash: true,
|
||||
reducedMotion: false,
|
||||
posterSize: 'comfortable',
|
||||
heroRotation: true,
|
||||
themeMusic: false,
|
||||
themeVolume: 30,
|
||||
movieSection: '',
|
||||
showSection: '',
|
||||
downloadDir: '',
|
||||
libraryViews: {},
|
||||
};
|
||||
|
||||
interface SettingsState extends Preferences {
|
||||
set<K extends keyof Preferences>(key: K, value: Preferences[K]): void;
|
||||
reset(): void;
|
||||
}
|
||||
|
||||
export const useSettings = create<SettingsState>()(
|
||||
persist(
|
||||
(set) => ({
|
||||
...defaults,
|
||||
set: (key, value) => set({ [key]: value } as Partial<SettingsState>),
|
||||
reset: () => set({ ...defaults }),
|
||||
}),
|
||||
{ name: 'kaleido.settings', version: 1 },
|
||||
),
|
||||
);
|
||||
|
||||
export const QUALITY_LABEL: Record<Quality, string> = {
|
||||
original: 'Original quality',
|
||||
'2160': '4K (40 Mbps)',
|
||||
'1080': '1080p (20 Mbps)',
|
||||
'720': '720p (4 Mbps)',
|
||||
'480': '480p (1.5 Mbps)',
|
||||
};
|
||||
|
||||
export const QUALITY_PROFILE: Record<Exclude<Quality, 'original'>, { kbps: number; width: number; height: number }> = {
|
||||
'2160': { kbps: 40000, width: 3840, height: 2160 },
|
||||
'1080': { kbps: 20000, width: 1920, height: 1080 },
|
||||
'720': { kbps: 4000, width: 1280, height: 720 },
|
||||
'480': { kbps: 1500, width: 854, height: 480 },
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue