#!/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
}
