← back to dennisrongo__cut-clean

Function bodies 405 total

All specs Real LLM only Function bodies
getActiveSegments function · typescript · L118-L120 (3 LOC)
src/models/VideoClip.ts
export function getActiveSegments(clip: VideoClip): Segment[] {
  return clip.segments.filter((s) => s.isActive);
}
getInactiveSegments function · typescript · L128-L130 (3 LOC)
src/models/VideoClip.ts
export function getInactiveSegments(clip: VideoClip): Segment[] {
  return clip.segments.filter((s) => !s.isActive);
}
isClipProcessed function · typescript · L138-L140 (3 LOC)
src/models/VideoClip.ts
export function isClipProcessed(clip: VideoClip): boolean {
  return clip.processingStatus === "completed" && clip.segments.length > 0;
}
analyzeVideoFull function · typescript · L36-L44 (9 LOC)
src/services/analysis-service.ts
export async function analyzeVideoFull(
  videoPath: string,
  clipId: string
): Promise<void> {
  await invoke("analyze_video_full", {
    videoPath,
    clipId,
  });
}
analyzeAudio function · typescript · L52-L60 (9 LOC)
src/services/analysis-service.ts
export async function analyzeAudio(
  videoPath: string,
  clipId: string
): Promise<void> {
  await invoke("analyze_audio_async", {
    videoPath,
    clipId,
  });
}
detectFillers function · typescript · L68-L76 (9 LOC)
src/services/analysis-service.ts
export async function detectFillers(
  videoPath: string,
  clipId: string
): Promise<void> {
  await invoke("detect_fillers_async", {
    videoPath,
    clipId,
  });
}
backendSegmentToFrontend function · typescript · L97-L112 (16 LOC)
src/services/analysis-service.ts
export function backendSegmentToFrontend(
  backend: TimelineSegmentBackend
): Segment {
  return {
    id: backend.id,
    clipId: backend.clip_id,
    startTime: backend.start_time,
    endTime: backend.end_time,
    duration: backend.duration,
    type: backend.segment_type as "filler_word" | "silence",
    content: backend.content,
    confidence: backend.confidence,
    isActive: backend.is_active,
    manuallyEdited: backend.manually_edited,
  };
}
About: code-quality intelligence by Repobility · https://repobility.com
getVideoMetadata function · typescript · L13-L15 (3 LOC)
src/services/video-service.ts
export async function getVideoMetadata(videoPath: string): Promise<VideoMetadata> {
  return await invoke<VideoMetadata>("get_video_metadata", { videoPath });
}
extractFrame function · typescript · L21-L26 (6 LOC)
src/services/video-service.ts
export async function extractFrame(videoPath: string, timestampSec: number): Promise<string> {
  return await invoke<string>("extract_frame", {
    videoPath,
    timestampSec,
  });
}
extractFramesAsync function · typescript · L31-L41 (11 LOC)
src/services/video-service.ts
export async function extractFramesAsync(
  videoPath: string,
  duration: number,
  count: number
): Promise<void> {
  await invoke("extract_frames_async", {
    videoPath,
    duration,
    count,
  });
}
generateWaveform function · typescript · L46-L54 (9 LOC)
src/services/video-service.ts
export async function generateWaveform(
  videoPath: string,
  samplesPerSecond: number = 10
): Promise<WaveformData> {
  return await invoke<WaveformData>("generate_waveform", {
    videoPath,
    samplesPerSecond: samplesPerSecond,
  });
}
generateWaveformAsync function · typescript · L59-L67 (9 LOC)
src/services/video-service.ts
export async function generateWaveformAsync(
  videoPath: string,
  samplesPerSecond: number = 10
): Promise<void> {
  await invoke("generate_waveform_async", {
    videoPath,
    samplesPerSecond: samplesPerSecond,
  });
}
stitchVideos function · typescript · L72-L84 (13 LOC)
src/services/video-service.ts
export async function stitchVideos(
  videoPaths: string[],
  outputPath: string,
  targetResolution?: { width: number; height: number }
): Promise<void> {
  await invoke("stitch_videos", {
    videoPaths,
    outputPath,
    targetResolution: targetResolution
      ? [targetResolution.width, targetResolution.height]
      : null,
  });
}
getVideoDuration function · typescript · L89-L91 (3 LOC)
src/services/video-service.ts
export async function getVideoDuration(videoPath: string): Promise<number> {
  return await invoke<number>("get_video_duration", { videoPath });
}
base64ToBlob function · typescript · L96-L104 (9 LOC)
src/services/video-service.ts
export function base64ToBlob(base64: string, mimeType = "image/png"): Blob {
  const byteString = atob(base64);
  const ab = new ArrayBuffer(byteString.length);
  const ia = new Uint8Array(ab);
  for (let i = 0; i < byteString.length; i++) {
    ia[i] = byteString.charCodeAt(i);
  }
  return new Blob([ab], { type: mimeType });
}
Repobility — the code-quality scanner for AI-generated software · https://repobility.com
base64ToDataUrl function · typescript · L109-L111 (3 LOC)
src/services/video-service.ts
export function base64ToDataUrl(base64: string): string {
  return `data:image/png;base64,${base64}`;
}
addRecentProject function · typescript · L29-L43 (15 LOC)
src/store/recentProjectsStore.ts
export async function addRecentProject(project: RecentProject): Promise<void> {
  const store = await load(STORE_FILE, { defaults: {} });

  const recent = await store.get<RecentProject[]>(RECENT_PROJECTS_KEY) || [];

  // Remove if already exists (will be re-added to top)
  const filtered = recent.filter((p) => p.path !== project.path);

  // Add to front, limit to MAX_RECENT
  const updated: RecentProject[] = [{ ...project, lastOpened: new Date().toISOString() }, ...filtered]
    .slice(0, MAX_RECENT);

  await store.set(RECENT_PROJECTS_KEY, updated);
  await store.save();
}
getRecentProjects function · typescript · L48-L60 (13 LOC)
src/store/recentProjectsStore.ts
export async function getRecentProjects(): Promise<RecentProject[]> {
  const store = await load(STORE_FILE, { defaults: {} });
  const recent = await store.get<RecentProject[]>(RECENT_PROJECTS_KEY);

  if (!recent) {
    return [];
  }

  // Sort by lastOpened descending (most recent first)
  return recent.sort((a, b) =>
    new Date(b.lastOpened).getTime() - new Date(a.lastOpened).getTime()
  );
}
removeRecentProject function · typescript · L65-L72 (8 LOC)
src/store/recentProjectsStore.ts
export async function removeRecentProject(path: string): Promise<void> {
  const store = await load(STORE_FILE, { defaults: {} });
  const recent = await store.get<RecentProject[]>(RECENT_PROJECTS_KEY) || [];

  const filtered = recent.filter((p) => p.path !== path);
  await store.set(RECENT_PROJECTS_KEY, filtered);
  await store.save();
}
clearRecentProjects function · typescript · L77-L81 (5 LOC)
src/store/recentProjectsStore.ts
export async function clearRecentProjects(): Promise<void> {
  const store = await load(STORE_FILE, { defaults: {} });
  await store.delete(RECENT_PROJECTS_KEY);
  await store.save();
}
updateRecentProjectName function · typescript · L86-L96 (11 LOC)
src/store/recentProjectsStore.ts
export async function updateRecentProjectName(path: string, name: string): Promise<void> {
  const store = await load(STORE_FILE, { defaults: {} });
  const recent = await store.get<RecentProject[]>(RECENT_PROJECTS_KEY) || [];

  const updated = recent.map((p) =>
    p.path === path ? { ...p, name, lastOpened: new Date().toISOString() } : p
  );

  await store.set(RECENT_PROJECTS_KEY, updated);
  await store.save();
}
getLastOpenedProject function · typescript · L101-L104 (4 LOC)
src/store/recentProjectsStore.ts
export async function getLastOpenedProject(): Promise<RecentProject | null> {
  const recent = await getRecentProjects();
  return recent.length > 0 ? recent[0] : null;
}
getLastProjectPath function · typescript · L16-L19 (4 LOC)
src/store/storePersistence.ts
export async function getLastProjectPath(): Promise<string | null> {
  const store = await load(STORE_FILE, { defaults: {} });
  return (await store.get<string>(LAST_PROJECT_KEY)) || null;
}
Generated by Repobility's multi-pass static-analysis pipeline (https://repobility.com)
setLastProjectPath function · typescript · L24-L28 (5 LOC)
src/store/storePersistence.ts
export async function setLastProjectPath(path: string): Promise<void> {
  const store = await load(STORE_FILE, { defaults: {} });
  await store.set(LAST_PROJECT_KEY, path);
  await store.save();
}
clearLastProjectPath function · typescript · L33-L37 (5 LOC)
src/store/storePersistence.ts
export async function clearLastProjectPath(): Promise<void> {
  const store = await load(STORE_FILE, { defaults: {} });
  await store.delete(LAST_PROJECT_KEY);
  await store.save();
}
main function · rust · L1-L3 (3 LOC)
src-tauri/build.rs
fn main() {
    tauri_build::build()
}
greet function · rust · L26-L28 (3 LOC)
src-tauri/src/commands/mod.rs
pub fn greet(name: &str) -> String {
    format!("Hello, {}! You've been greeted from Rust!", name)
}
get_video_metadata function · rust · L32-L34 (3 LOC)
src-tauri/src/commands/mod.rs
pub async fn get_video_metadata(video_path: String) -> Result<VideoMetadata, String> {
    services::video_processor::get_video_metadata(&video_path)
}
extract_frame function · rust · L38-L40 (3 LOC)
src-tauri/src/commands/mod.rs
pub fn extract_frame(video_path: String, timestamp_sec: f64) -> Result<String, String> {
    services::video_processor::extract_frame(&video_path, timestamp_sec)
}
extract_frames_async function · rust · L44-L47 (4 LOC)
src-tauri/src/commands/mod.rs
pub fn extract_frames_async(video_path: String, duration: f64, count: usize, app: AppHandle) -> Result<(), String> {
    services::video_processor::extract_frames_async(video_path, duration, count, app);
    Ok(())
}
generate_waveform function · rust · L51-L56 (6 LOC)
src-tauri/src/commands/mod.rs
pub fn generate_waveform(
    video_path: String,
    samples_per_second: usize,
) -> Result<services::waveform::WaveformData, String> {
    services::waveform::generate_waveform(&video_path, samples_per_second)
}
Repobility — same analyzer, your code, free for public repos · /scan/
generate_waveform_async function · rust · L60-L63 (4 LOC)
src-tauri/src/commands/mod.rs
pub fn generate_waveform_async(video_path: String, samples_per_second: usize, app: AppHandle) -> Result<(), String> {
    services::waveform::generate_waveform_async(video_path, samples_per_second, app);
    Ok(())
}
get_working_dir function · rust · L91-L114 (24 LOC)
src-tauri/src/commands/mod.rs
pub fn get_working_dir() -> Result<String, String> {
    use std::path::PathBuf;

    let docs_dir = dirs::document_dir()
        .ok_or("Failed to get Documents directory")?;

    let working_dir = docs_dir.join("cutclean");

    // Create directories if they don't exist
    std::fs::create_dir_all(&working_dir)
        .map_err(|e| format!("Failed to create working directory: {}", e))?;

    let imported_dir = working_dir.join("imported");
    std::fs::create_dir_all(&imported_dir)
        .map_err(|e| format!("Failed to create imported directory: {}", e))?;

    let working_files_dir = working_dir.join("working");
    std::fs::create_dir_all(&working_files_dir)
        .map_err(|e| format!("Failed to create working directory: {}", e))?;

    working_dir.to_str()
        .map(|s| s.to_string())
        .ok_or("Failed to convert working directory path to string".to_string())
}
get_video_duration function · rust · L118-L120 (3 LOC)
src-tauri/src/commands/mod.rs
pub fn get_video_duration(video_path: String) -> Result<f64, String> {
    video_stitcher::get_video_duration(&video_path)
}
analyze_audio_async function · rust · L124-L146 (23 LOC)
src-tauri/src/commands/mod.rs
pub fn analyze_audio_async(video_path: String, clip_id: String, app: AppHandle) -> Result<(), String> {
    thread::spawn(move || {
        let config = audio_processor::AudioAnalysisConfig::default();

        match audio_processor::analyze_audio(&video_path, &config) {
            Ok(result) => {
                // Emit completion event
                let _ = app.emit("audio-analysis-complete", AudioAnalysisPayload {
                    clip_id,
                    result,
                });
            }
            Err(e) => {
                let _ = app.emit("audio-analysis-error", ErrorPayload {
                    clip_id: clip_id.clone(),
                    error: e,
                });
            }
        }
    });

    Ok(())
}
detect_fillers_async function · rust · L150-L171 (22 LOC)
src-tauri/src/commands/mod.rs
pub fn detect_fillers_async(video_path: String, clip_id: String, app: AppHandle) -> Result<(), String> {
    thread::spawn(move || {
        let config = filler_detector::FillerDetectionConfig::default();

        match filler_detector::detect_fillers_from_audio(&video_path, &config) {
            Ok(detections) => {
                let _ = app.emit("filler-detection-complete", FillerDetectionPayload {
                    clip_id,
                    detections,
                });
            }
            Err(e) => {
                let _ = app.emit("filler-detection-error", ErrorPayload {
                    clip_id: clip_id.clone(),
                    error: e,
                });
            }
        }
    });

    Ok(())
}
analyze_video_full function · rust · L175-L258 (84 LOC)
src-tauri/src/commands/mod.rs
pub fn analyze_video_full(video_path: String, clip_id: String, app: AppHandle) -> Result<(), String> {
    let clip_id_clone = clip_id.clone();

    thread::spawn(move || {
        let rt = Runtime::new().unwrap();

        rt.block_on(async {
            // Emit progress
            let _ = app.emit("analysis-progress", AnalysisProgress {
                clip_id: clip_id_clone.clone(),
                stage: "Starting analysis".to_string(),
                progress: 0,
            });

            // Step 1: Analyze audio for silences
            let audio_config = audio_processor::AudioAnalysisConfig::default();
            let audio_result = match audio_processor::analyze_audio(&video_path, &audio_config) {
                Ok(r) => r,
                Err(e) => {
                    let _ = app.emit("analysis-error", ErrorPayload {
                        clip_id: clip_id_clone.clone(),
                        error: format!("Audio analysis failed: {}", e),
                    });
  
transcribe_video_async function · rust · L326-L332 (7 LOC)
src-tauri/src/commands/mod.rs
pub fn transcribe_video_async(
    video_path: String,
    clip_id: String,
    app: AppHandle,
) -> Result<(), String> {
    transcription::transcribe_video_async(video_path, clip_id, app)
}
get_available_models function · rust · L340-L342 (3 LOC)
src-tauri/src/commands/mod.rs
pub fn get_available_models() -> Vec<model_manager::ModelInfo> {
    model_manager::get_available_models()
}
About: code-quality intelligence by Repobility · https://repobility.com
get_active_model function · rust · L346-L348 (3 LOC)
src-tauri/src/commands/mod.rs
pub fn get_active_model() -> String {
    model_manager::get_active_model().model_name().to_string()
}
set_active_model function · rust · L352-L354 (3 LOC)
src-tauri/src/commands/mod.rs
pub fn set_active_model(model_name: String) -> Result<(), String> {
    model_manager::set_active_model(&model_name)
}
is_model_downloaded function · rust · L358-L360 (3 LOC)
src-tauri/src/commands/mod.rs
pub fn is_model_downloaded(model_name: String) -> Result<bool, String> {
    model_manager::is_model_downloaded(&model_name)
}
delete_model function · rust · L364-L366 (3 LOC)
src-tauri/src/commands/mod.rs
pub async fn delete_model(model_name: String) -> Result<(), String> {
    model_manager::delete_model_async(model_name).await
}
download_model function · rust · L370-L375 (6 LOC)
src-tauri/src/commands/mod.rs
pub async fn download_model(
    model_name: String,
    app: AppHandle,
) -> Result<(), String> {
    model_manager::download_model_async(model_name, app).await
}
get_theme function · rust · L383-L390 (8 LOC)
src-tauri/src/commands/mod.rs
pub fn get_theme() -> String {
    let app_settings = settings::get_settings();
    match app_settings.theme {
        settings::ThemeMode::Light => "light".to_string(),
        settings::ThemeMode::Dark => "dark".to_string(),
        settings::ThemeMode::System => "system".to_string(),
    }
}
set_theme function · rust · L394-L402 (9 LOC)
src-tauri/src/commands/mod.rs
pub fn set_theme(mode: String) -> Result<(), String> {
    let theme = match mode.as_str() {
        "light" => settings::ThemeMode::Light,
        "dark" => settings::ThemeMode::Dark,
        "system" => settings::ThemeMode::System,
        _ => return Err(format!("Invalid theme mode: {}", mode)),
    };
    settings::set_theme(theme)
}
save_transcription function · rust · L410-L434 (25 LOC)
src-tauri/src/commands/mod.rs
pub fn save_transcription(video_path: String, words: Vec<TranscriptionWordData>, full_text: String) -> Result<(), String> {
    use std::fs::File;
    use std::io::Write;
    use std::path::Path;

    // Create transcription file path next to the video
    let video_path_obj = Path::new(&video_path);
    let transcription_path = video_path_obj.with_extension("json");

    let transcription_data = serde_json::json!({
        "video_path": video_path,
        "words": words,
        "full_text": full_text,
        "created_at": chrono::Utc::now().to_rfc3339(),
    });

    let mut file = File::create(&transcription_path)
        .map_err(|e| format!("Failed to create transcription file: {}", e))?;

    file.write_all(serde_json::to_string_pretty(&transcription_data)
        .map_err(|e| format!("Failed to serialize transcription: {}", e))?.as_bytes())
        .map_err(|e| format!("Failed to write transcription: {}", e))?;

    Ok(())
}
Repobility — the code-quality scanner for AI-generated software · https://repobility.com
load_transcription function · rust · L438-L456 (19 LOC)
src-tauri/src/commands/mod.rs
pub fn load_transcription(video_path: String) -> Result<TranscriptionFileData, String> {
    use std::fs;
    use std::path::Path;

    let video_path_obj = Path::new(&video_path);
    let transcription_path = video_path_obj.with_extension("json");

    if !transcription_path.exists() {
        return Err("No transcription file found".to_string());
    }

    let content = fs::read_to_string(&transcription_path)
        .map_err(|e| format!("Failed to read transcription file: {}", e))?;

    let data: TranscriptionFileData = serde_json::from_str(&content)
        .map_err(|e| format!("Failed to parse transcription file: {}", e))?;

    Ok(data)
}
has_transcription function · rust · L460-L465 (6 LOC)
src-tauri/src/commands/mod.rs
pub fn has_transcription(video_path: String) -> bool {
    use std::path::Path;
    let video_path_obj = Path::new(&video_path);
    let transcription_path = video_path_obj.with_extension("json");
    transcription_path.exists()
}
save_project function · rust · L502-L504 (3 LOC)
src-tauri/src/commands/mod.rs
pub async fn save_project(file_path: String, project_data: Value) -> Result<(), String> {
    project_io::atomic_write_json(&file_path, &project_data)
}
‹ prevpage 3 / 9next ›