Compare commits

..

2 Commits

Author SHA1 Message Date
Vincent Riquer
45433fa214 Merge branch '10-bug-releasecountry-change-should-update-dest-files' into 'master'
Resolve "BUG: releasecountry change should update dest files"

Closes #10

See merge request atom/AtOM!16
2025-02-10 18:57:38 +00:00
Vincent Riquer
92a5ba0234 Resolve "BUG: releasecountry change should update dest files" 2025-02-10 18:57:38 +00:00
3 changed files with 35 additions and 1 deletions

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
currentdbversion=4 currentdbversion=5
checkDatabaseVersion() { checkDatabaseVersion() {
local dbversion local dbversion
if dbversion=$(Select atom version <<<"\"1\" = 1") if dbversion=$(Select atom version <<<"\"1\" = 1")

View File

@ -0,0 +1,33 @@
#!/bin/bash
upgradedatabase_4_5() {
echo "Upgrading database to version 5... (backup is $database.bak_v4)"
cp "$database" "$database.bak_v4"
echo 'DROP TRIGGER force_destination_update_on_tag_update;' >&3
echo '
CREATE TRIGGER IF NOT EXISTS force_destination_update_on_tag_update
AFTER UPDATE OF
genre,
albumartist,
year,
album,
disc,
artist,
track,
title,
composer,
performer,
releasecountry,
rate,
channels,
bitrate,
bitdepth
ON tags
BEGIN
UPDATE destination_files SET last_change=0
WHERE source_file_id=old.source_file;
END;
' >&3
Update atom version 5 <<<"1 = 1"
}

View File

@ -130,6 +130,7 @@ CREATE TRIGGER IF NOT EXISTS force_destination_update_on_tag_update
title, title,
composer, composer,
performer, performer,
releasecountry,
rate, rate,
channels, channels,
bitrate, bitrate,