Fix problem with Radarr identifying reverse-symlinked files as new, and potentially overwriting movies as a result

Dave 2020-04-25 17:33:52 -04:00
parent 28a511649f
commit c5bd7b890b
1 changed files with 9 additions and 0 deletions

@ -180,8 +180,17 @@ while [[ $PERMFILESIZE != $ORIGFILESIZE ]]; do
done
if [[ $PERMFILESIZE == $ORIGFILESIZE ]]; then
# Save current time stamps to prevent radarr from identifying our simlink as new, and double-processing it
LINKDIR=$(dirname "$LINKPATH")
FOLDER_DATE=$(date -r "$LINKDIR" +@%s.%N)
FILE_DATE=$(date -r "$LINKPATH" +@%s.%N)
rm "$LINKPATH"
ln -s "$PERMPATH" "$LINKPATH"
touch --no-create --no-dereference --date "$FILE_DATE" "$LINKPATH"
touch --no-create --no-dereference --date "$FILE_DATE" "$PERMPATH"
touch --no-create --no-dereference --date "$FOLDER_DATE" "$LINKDIR"
fi
```