Posts: 202
Joined: Nov 2009
Reputation:
0
Hi All,
I run my system with a SQL backend. With the implementation of adding tags by default with scraping, I now have thousands of, for lack of a better word, useless tags. It's so overwhelming that it makes navigating to my own tags extremely time consuming.
Removing the tags within Kodi is time consuming to the point of it being impractical to do so with thousands of tags. Having to go into each individual tag and remove every item manually . . . Talking about probably 10000+ "clicks" to do it.
So, what I'm hoping to do is to remove Tags directly from the SQL backend but I don't want to go down this road if it's going to kill my database.
Thoughts appreciated.
Posts: 1,369
Joined: Apr 2010
Reputation:
110
CrystalP
Team-Kodi Developer
Posts: 1,369
Tags are stored in the tag (tag name) and tag_link (link with a movie, show, ...) tables.
As long as the referential integrity is not broken between those two tables, the database shouldn't be corrupted.
But backups provide peace of mind.
Posts: 202
Joined: Nov 2009
Reputation:
0
Hi All -
To each of you, thank you.
individual response: CrystalP and jbinkley60: Appreciate the input and will try to purge. As far as identifying, recreating is a possibility (in fact true that I only have about 5-10 useful tags and about 2200 useless ones. But I'm actually fine just typing up a list of the useless ones and going one by one if I can purge the entire tag without having to first remove items one by one. This at least makes it a 2190 deletion project instead of a 10,000+ deletion process.
Crawfish: Also considered just starting from scratch but it took me a long time to clean my db and make it perfect with the number of items that I have. The last time I purged was a few years back and honestly, it took months to go one by one and ensure that every item was scraped right, had the art that I wanted to use, ratings seemed sane, etc.... doing that again....sounds like more work than just keeping a couple thousand useless tags. I agree 100% that the default option being to pull the tags is insanity, who wants to base their tags on some other randos ideas of what deserves to be tagged?! The number of tags that I have that are: (1) entirely inappropriate; (2) repetitive; and (3) have a single item or two, is just proof that people don't know how to use tags appropriately and now we're stuck by default using their insanity.
Posts: 1,369
Joined: Apr 2010
Reputation:
110
CrystalP
Team-Kodi Developer
Posts: 1,369
There is an in-between, if you want to keep only a few tags, then make the database engine work for you to remove everything else.
Identify the list of tag_id values that you want to keep with a query like this for each tag "select tag_id from tag where name = 'the text of the tag to preserve' " - or use a front end to visualize the table.
Then "delete from tag where tag_id not in ( tag_id#1, tag_id#2, tag_id#3)" obviously replacing the tag_id#1 etc with the actual tag_id values from the first query, and add as many tag_id as you need, separated with commas.
Finally "delete from tag_link where tag_id not in ( tag_id_1, tag_id_2, tag_id_3)" same deal as previous query to build the list of tag_id.
It's best to backup first, especially if you're not comfortable with the SQL language.