allow ignoring microseconds in file timestamps

This commit is contained in:
Vincent Riquer 2025-11-09 02:06:02 +01:00
parent b6110cf626
commit c8974a2aff
3 changed files with 14 additions and 1 deletions

View File

@ -75,6 +75,9 @@ getConfigGeneral() {
'database') 'database')
database="$value" database="$value"
;; ;;
'skip-timestamp-microsec')
skip_us_timestamp="$value"
;;
debug) debug)
(( value > debug )) && debug=$value (( value > debug )) && debug=$value
;; ;;

View File

@ -33,6 +33,9 @@ database $database
# * debug <level>: Integer. # * debug <level>: Integer.
#debug 1 #debug 1
# * skip-timestamp-microsec: Ignore microsecond precision in timestamps.
skip-timestamp-microsec ${skip_us_timestamp:-0}
[source] [source]
# This section defines where are the files you want transcoded. # This section defines where are the files you want transcoded.

View File

@ -10,10 +10,17 @@ getFiles() {
echo 'BEGIN TRANSACTION;' >&3 echo 'BEGIN TRANSACTION;' >&3
while read time size filename while read time size filename
do do
if (( skip_us_timestamp ))
then
compare_time=${time%.*}.%
else
compare_time=$time
fi
if ! Select source_files id >/dev/null <<-EOWhere if ! Select source_files id >/dev/null <<-EOWhere
filename = $filename filename = $filename
mime_type > 0 mime_type > 0
last_change = $time last_change LIKE $compare_time
size = $size
EOWhere EOWhere
then then
mimetype=$(file -b --mime-type "$sourcepath/$filename") mimetype=$(file -b --mime-type "$sourcepath/$filename")