From 3995e9232327c0ef7a7169e533dc1947c08f5976 Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Fri, 13 Mar 2026 17:38:41 +0100 Subject: [PATCH] comment lib/files/* --- lib/files/removeObsoleteFiles | 17 +++++++++++++++++ lib/files/sanitizeFile | 16 +++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/lib/files/removeObsoleteFiles b/lib/files/removeObsoleteFiles index 69bd04b..65e9561 100644 --- a/lib/files/removeObsoleteFiles +++ b/lib/files/removeObsoleteFiles @@ -1,5 +1,22 @@ #!/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() { + # 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 last_seen < $scantime EOWhere diff --git a/lib/files/sanitizeFile b/lib/files/sanitizeFile index 164ca9b..e1659a6 100644 --- a/lib/files/sanitizeFile +++ b/lib/files/sanitizeFile @@ -1,4 +1,18 @@ #!/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() { shopt -s extglob string="$1" @@ -6,7 +20,7 @@ sanitizeFile() { string="${string//\// }" if (( ${destinationfat32compat[$destination]} )) then - # Filenames can't contain: + # FAT32 forbids these characters in filenames string=${string//\?/ } string=${string//\\/ } string=${string//