mirror of
https://github.com/xpltdco/media-rip.git
synced 2026-04-03 02:53:58 -06:00
Full-featured self-hosted yt-dlp web frontend:
- Python 3.12+ / FastAPI backend with async SQLite, SSE transport, session isolation
- Vue 3 / TypeScript / Pinia frontend with real-time progress, theme picker
- 3 built-in themes (cyberpunk/dark/light) + drop-in custom theme system
- Admin auth (bcrypt), purge system, cookie upload, file serving
- Docker multi-stage build, GitHub Actions CI/CD
- 179 backend tests, 29 frontend tests (208 total)
Slices: S01 (Foundation), S02 (SSE+Sessions), S03 (Frontend),
S04 (Admin+Auth), S05 (Themes), S06 (Docker+CI)
33 lines
777 B
TypeScript
33 lines
777 B
TypeScript
/**
|
|
* Config Pinia store — loads and caches public configuration.
|
|
*/
|
|
|
|
import { ref } from 'vue'
|
|
import { defineStore } from 'pinia'
|
|
import { api } from '@/api/client'
|
|
import type { PublicConfig } from '@/api/types'
|
|
|
|
export const useConfigStore = defineStore('config', () => {
|
|
const config = ref<PublicConfig | null>(null)
|
|
const isLoading = ref(false)
|
|
const error = ref<string | null>(null)
|
|
|
|
async function loadConfig(): Promise<void> {
|
|
isLoading.value = true
|
|
error.value = null
|
|
try {
|
|
config.value = await api.getPublicConfig()
|
|
} catch (err: any) {
|
|
error.value = err.message || 'Failed to load configuration'
|
|
} finally {
|
|
isLoading.value = false
|
|
}
|
|
}
|
|
|
|
return {
|
|
config,
|
|
isLoading,
|
|
error,
|
|
loadConfig,
|
|
}
|
|
})
|