From 0e751a407d354a87eed52df98baffcd70ba03086 Mon Sep 17 00:00:00 2001 From: 44r0n7 <44r0n7+gitea@pm.me> Date: Wed, 31 Dec 2025 22:39:25 -0500 Subject: [PATCH] Add README, license, and check script --- LICENSE | 21 ++++++++++++++ README.md | 72 ++++++++++++++++++++++++++++++++++++++++++++++++ scripts/check.sh | 5 ++++ 3 files changed, 98 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100755 scripts/check.sh diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..14fac91 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..3db4682 --- /dev/null +++ b/README.md @@ -0,0 +1,72 @@ +# Vid-Repair + +Vid-Repair is a cross‑platform Rust CLI that scans video files for container/stream/decode problems and applies safe repairs using system `ffmpeg`/`ffprobe`. + +## Features + +- Scan: ffprobe metadata + ffmpeg decode pass +- Data‑driven rulesets (TOML) with linting +- Safe fix planning (remux/faststart) + optional aggressive re‑encode +- Atomic replace + optional keep‑original +- Watch mode with settle window +- Text output by default, JSON with schema version + +## Requirements + +- `ffmpeg` and `ffprobe` available on PATH + +## Install + +```bash +cargo build --release +``` + +## Usage + +```bash +# Scan +vid-repair scan /path/to/videos + +# Scan and watch for new files +vid-repair scan --watch /path/to/videos + +# Fix (safe policy, in-place) +vid-repair fix /path/to/videos + +# Fix with aggressive policy +vid-repair fix --policy aggressive /path/to/videos + +# JSON output +vid-repair scan --json /path/to/videos + +# Lint rulesets +vid-repair rules lint +``` + +Exit codes: +- `0` no issues +- `1` issues found +- `2` fix failed +- `3` fatal error + +## Config + +On first run, a commented TOML config is created in the XDG config directory: + +- Linux: `~/.config/vid-repair/config.toml` +- macOS: `~/Library/Application Support/vid-repair/config.toml` +- Windows: `%APPDATA%/vid-repair/config.toml` + +CLI flags override config values. + +## Rulesets + +Rules are stored in `rulesets/*.toml`. Use `vid-repair rules lint` before shipping changes. + +## Fixtures + +Generate fixtures (git‑ignored) with: + +```bash +scripts/generate_fixtures.sh +``` diff --git a/scripts/check.sh b/scripts/check.sh new file mode 100755 index 0000000..4f64956 --- /dev/null +++ b/scripts/check.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail + +cargo test +cargo run -p vid-repair -- rules lint