take a look at this example:
This is the final sql code (small sample) I have used to update my movie collection tags :
–2137 1100010100 1100010100 1100010100
INSERT INTO taggings (metadata_item_id,tag_id,‘index’,text,thumb_url,created_at,extra_data) VALUES (2137,45590,1,‘’,‘’,datetime(‘now’),‘’);
INSERT INTO taggings (metadata_item_id,tag_id,‘index’,text,thumb_url,created_at,extra_data) VALUES (2137,45591,2,‘’,‘’,datetime(‘now’),‘’);
INSERT INTO taggings (metadata_item_id,tag_id,‘index’,text,thumb_url,created_at,extra_data) VALUES (2137,45595,3,‘’,‘’,datetime(‘now’),‘’);
INSERT INTO taggings (metadata_item_id,tag_id,‘index’,text,thumb_url,created_at,extra_data) VALUES (2137,45597,4,‘’,‘’,datetime(‘now’),‘’);
UPDATE metadata_items SET user_fields = ‘lockedFields=16’ WHERE ID =2137;
–1597 0000000010 0000000010 0000000010
INSERT INTO taggings (metadata_item_id,tag_id,‘index’,text,thumb_url,created_at,extra_data) VALUES (1597,45610,1,‘’,‘’,datetime(‘now’),‘’);
UPDATE metadata_items SET user_fields = ‘lockedFields=16’ WHERE ID =1597;
–1558 0000100010 0000100010 0000100010
INSERT INTO taggings (metadata_item_id,tag_id,‘index’,text,thumb_url,created_at,extra_data) VALUES (1558,45594,1,‘’,‘’,datetime(‘now’),‘’);
INSERT INTO taggings (metadata_item_id,tag_id,‘index’,text,thumb_url,created_at,extra_data) VALUES (1558,45610,2,‘’,‘’,datetime(‘now’),‘’);
UPDATE metadata_items SET user_fields = ‘lockedFields=16’ WHERE ID =1558;
–2722 0100000000 0100000000 0100000000
so movie (agent cody banks represented in the database by 2137) 2137 and tag 45590(45590 = ash-ama short for my two dauthers ) but in this case i had four collection tags (ash-ama and disney,etc) so i run the same sql statement, incrementing the index tag for each collection tag
just info for me to check the process
–2137 1100010100 1100010100 1100010100
first collection tag for movie 2137 agent cody banks
INSERT INTO taggings (metadata_item_id,tag_id,‘index’,text,thumb_url,created_at,extra_data) VALUES (2137,45590,1,‘’,‘’,datetime(‘now’),‘’);
second collection tag for movie 2137 agent cody banks
INSERT INTO taggings (metadata_item_id,tag_id,‘index’,text,thumb_url,created_at,extra_data) VALUES (2137,45591,2,‘’,‘’,datetime(‘now’),‘’);
third collection tag for movie 2137 agent cody banks
INSERT INTO taggings (metadata_item_id,tag_id,‘index’,text,thumb_url,created_at,extra_data) VALUES (2137,45595,3,‘’,‘’,datetime(‘now’),‘’);
fourthcollection tag for movie 2137 agent cody banks
INSERT INTO taggings (metadata_item_id,tag_id,‘index’,text,thumb_url,created_at,extra_data) VALUES (2137,45597,4,‘’,‘’,datetime(‘now’),‘’);
lock the collection tags so plex agent does not overwrite them
UPDATE metadata_items SET user_fields = ‘lockedFields=16’ WHERE ID =2137;
just info for me to check the process
–1597 0000000010 0000000010 0000000010
**first collection tag for movie 1597 (some movie) by the way this movie only had one tag **
INSERT INTO taggings (metadata_item_id,tag_id,‘index’,text,thumb_url,created_at,extra_data) VALUES (1597,45610,1,‘’,‘’,datetime(‘now’),‘’);
lock the collection tags so plex agent does not overwrite them
UPDATE metadata_items SET user_fields = ‘lockedFields=16’ WHERE ID =1597;
by the way I generated the sqlite statements using some php code so it was all automated