feat: add local files provider with indexing and rescan functionality

- Implemented LocalFilesProvider to manage local video files.
- Added LocalIndex for in-memory and SQLite-backed indexing of video files.
- Introduced scanning functionality to detect video files and extract metadata.
- Added API endpoints for listing collections, genres, and series based on provider capabilities.
- Enhanced existing routes to check for provider capabilities before processing requests.
- Updated frontend to utilize provider capabilities for conditional rendering of UI elements.
- Implemented rescan functionality to refresh the local files index.
- Added database migration for local files index schema.
This commit is contained in:
2026-03-14 03:44:32 +01:00
parent 9b6bcfc566
commit 8f42164bce
30 changed files with 1033 additions and 59 deletions

View File

@@ -1,6 +1,5 @@
use axum::{Json, Router, extract::State, routing::get};
use std::sync::Arc;
use crate::config::Config;
use crate::dto::ConfigResponse;
use crate::state::AppState;
@@ -8,8 +7,9 @@ pub fn router() -> Router<AppState> {
Router::new().route("/", get(get_config))
}
async fn get_config(State(config): State<Arc<Config>>) -> Json<ConfigResponse> {
async fn get_config(State(state): State<AppState>) -> Json<ConfigResponse> {
Json(ConfigResponse {
allow_registration: config.allow_registration,
allow_registration: state.config.allow_registration,
provider_capabilities: state.media_provider.capabilities(),
})
}