From c8c7606eb7390a0ed70572e8f306f2cbf479137c Mon Sep 17 00:00:00 2001 From: ediblerope Date: Wed, 15 Apr 2026 19:22:24 +0100 Subject: [PATCH] Skip hardlinked files in transcode-hevc to avoid breaking seed links Files with multiple hardlinks are likely linked from downloads/ where they are still being seeded. Transcoding would break the hardlink and cause both copies to take up disk space separately. Co-Authored-By: Claude Opus 4.6 --- scripts/transcode-hevc.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/transcode-hevc.sh b/scripts/transcode-hevc.sh index c79ea9a..03a34e9 100644 --- a/scripts/transcode-hevc.sh +++ b/scripts/transcode-hevc.sh @@ -152,6 +152,13 @@ while IFS= read -r -d '' file; do continue fi + # Skip files with hardlinks (likely still linked to downloads for seeding) + link_count=$(stat -c%h "$file") + if [[ "$link_count" -gt 1 ]]; then + log "Skipping (hardlinked, likely still seeding): $file" + continue + fi + original_size=$(stat -c%s "$file") original_size_h=$(get_size_human "$file") original_duration=$(get_duration "$file")