feat: scaffold Tauri v2 + Svelte 5 project with base layout and utilities
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1
src-tauri/src/commands/dependencies.rs
Normal file
1
src-tauri/src/commands/dependencies.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Dependency check and install commands — implemented in Task 2
|
||||
1
src-tauri/src/commands/export.rs
Normal file
1
src-tauri/src/commands/export.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Clip export commands — implemented in Task 12
|
||||
1
src-tauri/src/commands/media_analysis.rs
Normal file
1
src-tauri/src/commands/media_analysis.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Keyframe, waveform, thumbnail extraction commands — implemented in Tasks 9-11
|
||||
4
src-tauri/src/commands/mod.rs
Normal file
4
src-tauri/src/commands/mod.rs
Normal file
@@ -0,0 +1,4 @@
|
||||
pub mod dependencies;
|
||||
pub mod export;
|
||||
pub mod media_analysis;
|
||||
pub mod video;
|
||||
1
src-tauri/src/commands/video.rs
Normal file
1
src-tauri/src/commands/video.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Video resolve and download commands — implemented in Task 4/5
|
||||
14
src-tauri/src/lib.rs
Normal file
14
src-tauri/src/lib.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
mod commands;
|
||||
mod models;
|
||||
mod services;
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_shell::init())
|
||||
.plugin(tauri_plugin_dialog::init())
|
||||
.plugin(tauri_plugin_store::Builder::new().build())
|
||||
.plugin(tauri_plugin_process::init())
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
6
src-tauri/src/main.rs
Normal file
6
src-tauri/src/main.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
fn main() {
|
||||
tauri_app_lib::run()
|
||||
}
|
||||
105
src-tauri/src/models.rs
Normal file
105
src-tauri/src/models.rs
Normal file
@@ -0,0 +1,105 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct VideoMetadata {
|
||||
pub url: String,
|
||||
pub title: String,
|
||||
pub duration: f64,
|
||||
pub fps: f64,
|
||||
pub thumbnail_url: Option<String>,
|
||||
pub stream_url: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Clip {
|
||||
pub id: String,
|
||||
pub start_time: f64,
|
||||
pub end_time: f64,
|
||||
pub label: String,
|
||||
pub color: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ThumbnailSpritesheet {
|
||||
pub file_path: String,
|
||||
pub start_index: usize,
|
||||
pub count: usize,
|
||||
pub thumb_width: u32,
|
||||
pub thumb_height: u32,
|
||||
pub columns: u32,
|
||||
pub interval_seconds: f64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase", tag = "type")]
|
||||
pub enum CookieSource {
|
||||
#[serde(rename = "browser")]
|
||||
Browser { browser: String },
|
||||
#[serde(rename = "file")]
|
||||
File { path: String },
|
||||
#[serde(rename = "none")]
|
||||
None,
|
||||
}
|
||||
|
||||
impl CookieSource {
|
||||
pub fn to_ytdlp_args(&self) -> Vec<String> {
|
||||
match self {
|
||||
CookieSource::Browser { browser } => {
|
||||
vec!["--cookies-from-browser".to_string(), browser.clone()]
|
||||
}
|
||||
CookieSource::File { path } => {
|
||||
vec!["--cookies".to_string(), path.clone()]
|
||||
}
|
||||
CookieSource::None => vec![],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for CookieSource {
|
||||
fn default() -> Self {
|
||||
CookieSource::Browser {
|
||||
browser: "firefox".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase", tag = "mode")]
|
||||
pub enum CutMode {
|
||||
#[serde(rename = "lossless")]
|
||||
Lossless,
|
||||
#[serde(rename = "precise")]
|
||||
Precise { format: String },
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase", tag = "scope")]
|
||||
pub enum ExportScope {
|
||||
#[serde(rename = "individual")]
|
||||
Individual,
|
||||
#[serde(rename = "merged")]
|
||||
Merged,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ExportConfig {
|
||||
pub clips: Vec<Clip>,
|
||||
pub cut_mode: CutMode,
|
||||
pub export_scope: ExportScope,
|
||||
pub output_directory: String,
|
||||
pub video_title: String,
|
||||
pub source_file_path: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct DependencyStatus {
|
||||
pub name: String,
|
||||
pub installed: bool,
|
||||
pub version: Option<String>,
|
||||
pub install_command: String,
|
||||
}
|
||||
1
src-tauri/src/services/clip_exporter.rs
Normal file
1
src-tauri/src/services/clip_exporter.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Implemented in Task 12
|
||||
1
src-tauri/src/services/dependency_manager.rs
Normal file
1
src-tauri/src/services/dependency_manager.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Implemented in Task 2
|
||||
1
src-tauri/src/services/download_manager.rs
Normal file
1
src-tauri/src/services/download_manager.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Implemented in Task 5
|
||||
1
src-tauri/src/services/keyframe_index.rs
Normal file
1
src-tauri/src/services/keyframe_index.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Implemented in Task 9
|
||||
7
src-tauri/src/services/mod.rs
Normal file
7
src-tauri/src/services/mod.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
pub mod clip_exporter;
|
||||
pub mod dependency_manager;
|
||||
pub mod download_manager;
|
||||
pub mod keyframe_index;
|
||||
pub mod thumbnail_extractor;
|
||||
pub mod video_resolver;
|
||||
pub mod waveform_generator;
|
||||
1
src-tauri/src/services/thumbnail_extractor.rs
Normal file
1
src-tauri/src/services/thumbnail_extractor.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Implemented in Task 11
|
||||
1
src-tauri/src/services/video_resolver.rs
Normal file
1
src-tauri/src/services/video_resolver.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Implemented in Task 4
|
||||
1
src-tauri/src/services/waveform_generator.rs
Normal file
1
src-tauri/src/services/waveform_generator.rs
Normal file
@@ -0,0 +1 @@
|
||||
// Implemented in Task 10
|
||||
Reference in New Issue
Block a user