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 <noreply@anthropic.com>
This commit is contained in:
ediblerope 2026-04-15 19:22:24 +01:00
parent f431d1a5b0
commit c8c7606eb7

View file

@ -152,6 +152,13 @@ while IFS= read -r -d '' file; do
continue continue
fi 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=$(stat -c%s "$file")
original_size_h=$(get_size_human "$file") original_size_h=$(get_size_human "$file")
original_duration=$(get_duration "$file") original_duration=$(get_duration "$file")