comment lib/files/*

This commit is contained in:
Vincent Riquer 2026-03-13 17:38:41 +01:00
parent c9a21637c6
commit 3995e92323
2 changed files with 32 additions and 1 deletions

View File

@ -1,5 +1,22 @@
#!/bin/bash #!/bin/bash
# Copyright © 2012-2026 ScriptFanix
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# A copy of the GNU General Public License v3 is includded in the LICENSE file
# at the root of the project.
removeObsoleteFiles() { removeObsoleteFiles() {
# Delete source_files records that were not seen in the latest scan.
# The DB's ON DELETE CASCADE will remove tags
# ON DELETE SET NULL will let us take care of destination_files later.
Delete source_files <<-EOWhere Delete source_files <<-EOWhere
last_seen < $scantime last_seen < $scantime
EOWhere EOWhere

View File

@ -1,4 +1,18 @@
#!/bin/bash #!/bin/bash
# Copyright © 2012-2026 ScriptFanix
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# A copy of the GNU General Public License v3 is includded in the LICENSE file
# at the root of the project.
sanitizeFile() { sanitizeFile() {
shopt -s extglob shopt -s extglob
string="$1" string="$1"
@ -6,7 +20,7 @@ sanitizeFile() {
string="${string//\// }" string="${string//\// }"
if (( ${destinationfat32compat[$destination]} )) if (( ${destinationfat32compat[$destination]} ))
then then
# Filenames can't contain: # FAT32 forbids these characters in filenames
string=${string//\?/ } string=${string//\?/ }
string=${string//\\/ } string=${string//\\/ }
string=${string//</ } string=${string//</ }