Adding Tags through SQL - changes get lost

Server Version#: 1.13.9.5456
Player Version#: 3.69.1

Hi there!

I have a ton of home videos that I want to put in some collections. As that are literally hundreds, I do not want to select each video and add the collection tag. That was the only way I found through the GUI - if there is another one, please tell me!

Therefore, I opted to manipulate the database itself and did the following steps:

  1. Stopped Plex server (running in docker on my Linux server)
  2. copied the database to my desktop
  3. opened com.plexapp.plugins.library.db with an SQLite tool (Lift Lite - https://itunes.apple.com/ch/app/lift-lite/id1440179067?l=en&mt=12)
  4. got the metadata_items - id of all items that I wanted to tag and are not yet tagged: select id from metadata_items where title like ‘2005-Israel%’ and id not in (select metadata_item_id from taggings where tag_id=44921) – 44921 is the tag-id of the tag that I already gave to a few items through the gui
  5. exported the result and using a small python script, generated a sql file with all insert statements that looked like this (just two of them, total count around 100): INSERT INTO taggings (“metadata_item_id”, “tag_id”, “index”, “created_at”) VALUES (216508, 44921, 0, “2018-12-13 22:22:22”);
    INSERT INTO taggings (“metadata_item_id”, “tag_id”, “index”, “created_at”) VALUES (216509, 44921, 0, “2018-12-13 22:22:22”);
  6. copied the db file back
  7. started plex
  8. the tags are not there.
  9. stopped plex again and checked the db file - my entries are gone?

Can somebody explain me where to do that? Or why that does not work?
Thanks in advance!

Unfortunately I can’t tell you more about the database structure, but I can point you here:

Awesome! It actually works to add collection-tags this way. I thought i already tried that. And then very quickly the programmer instinct kicked it that this should be solvable through force :smiley:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.