smarter tags update trigger

This commit is contained in:
Vincent Riquer 2013-05-25 15:03:50 +02:00
parent bb484454a6
commit 24aef12e33

View File

@ -110,8 +110,23 @@ CREATE TRIGGER IF NOT EXISTS create_tags AFTER INSERT ON source_files
BEGIN BEGIN
INSERT INTO tags (source_file,last_change) VALUES (new.id,0); INSERT INTO tags (source_file,last_change) VALUES (new.id,0);
END; END;
CREATE TRIGGER IF NOT EXISTS force_destination_update_on_tag_update DROP TRIGGER IF EXISTS force_destination_update_on_tag_update;
AFTER UPDATE ON tags CREATE TRIGGER force_destination_update_on_tag_update
AFTER UPDATE OF
genre,
albumartist,
year,
album,
disc,
artist,
track,
title,
composer,
performer,
rate,
channels,
bitrate
ON tags
BEGIN BEGIN
UPDATE destination_files SET last_change=0 UPDATE destination_files SET last_change=0
WHERE source_file_id=old.source_file; WHERE source_file_id=old.source_file;