update mime_types
This commit is contained in:
parent
506bf59a24
commit
f7a6fba366
34
atom
34
atom
@ -520,6 +520,38 @@ getFiles() {
|
||||
echo
|
||||
}
|
||||
|
||||
updateMimes() {
|
||||
Update mime_types action 1 <<<"action != 1"
|
||||
for destination in ${!destinationskipmime[@]}
|
||||
do
|
||||
IFS='|'
|
||||
for mime_type in ${destinationskipmime["$destination"]}
|
||||
do
|
||||
IFS="$oldIFS"
|
||||
Update mime_types action 0 >/dev/null < <(
|
||||
cat <<-EOWhere
|
||||
destination_id ${destinationid["$destination"]}
|
||||
mime_text LIKE ${mime_type//*/%}
|
||||
EOWhere
|
||||
)
|
||||
done
|
||||
done
|
||||
for destination in ${!destinationcopymime[@]}
|
||||
do
|
||||
IFS='|'
|
||||
for mime_type in ${destinationcopymime["$destination"]}
|
||||
do
|
||||
IFS="$oldIFS"
|
||||
Update mime_types action 2 >/dev/null < <(
|
||||
cat <<-EOWhere
|
||||
destination_id ${destinationid["$destination"]}
|
||||
mime_text LIKE ${mime_type//*/%}
|
||||
EOWhere
|
||||
)
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
removeObsoleteFiles() {
|
||||
Delete source_files <<-EOWhere
|
||||
last_seen < $scantime
|
||||
@ -659,6 +691,8 @@ createDestinations
|
||||
|
||||
getFiles
|
||||
|
||||
updateMimes
|
||||
|
||||
removeObsoleteFiles
|
||||
|
||||
closeDatabase
|
||||
|
||||
@ -26,7 +26,8 @@ CREATE TABLE mime_types (
|
||||
id INTEGER PRIMARY KEY,
|
||||
destination_id INTEGER,
|
||||
mime_text TEXT UNIQUE NOT NULL,
|
||||
action INTEGER DEFAULT 1
|
||||
action INTEGER DEFAULT 1,
|
||||
FOREIGN KEY (destination_id) REFERENCES destinations(id)
|
||||
);
|
||||
|
||||
CREATE INDEX sourcefiles_by_name ON source_files (filename,id);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user