Kodi Community Forum
Solved Remove Genres After Editing NFO and Using SQL Server - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: Solved Remove Genres After Editing NFO and Using SQL Server (/showthread.php?tid=363981)



Remove Genres After Editing NFO and Using SQL Server - FlashPan - 2021-08-14

Hello all,

All my media have thier own .nfo  My Kodi instances are also using SQL server to sync databases etc.

Over the years I've made some random mistakes with custom genre names with mispelling etc.

I've gone through all my .nfo files with notepadd++ and corrected the mistakes.

Within Kodi under Genres I still see the old/incorrect Genre names.

How can I remove these incorrect names please?  I was thinking to change the source of my media to none and then back to .nfo to force a rescrape but am not sure if I will loose my watched status?  Or even if that would work.

Any ideas please?

Thanks and cheers in advance.


RE: Remove Genres After Editing NFO and Using SQL Server - Karellen - 2021-08-14

(2021-08-14, 09:32)FlashPan Wrote: I've gone through all my .nfo files with notepadd++ and corrected the mistakes.

Within Kodi under Genres I still see the old/incorrect Genre names.
Editing the nfo files is not enough. Did you Refresh the nfo files into the library?

An easier way would be to install the Metadata addon and edit the genres in Kodi. Then you can run an Export to Separate files to refresh your nfo files for backup purposes.

https://forum.kodi.tv/showthread.php?tid=349035
Settings>Add-ons>Install from repository>Program add-ons>Metadata Editor


RE: Remove Genres After Editing NFO and Using SQL Server - Klojum - 2021-08-14

(2021-08-14, 09:32)FlashPan Wrote: Within Kodi under Genres I still see the old/incorrect Genre names.
How can I remove these incorrect names please?  I

How "bad" are those incorrect names? Knowing SQL commands would be a time-saver for sure. (Always make a backup before you start hacking your database)

I had a couple of SQL queries fixing the non-English genre names to English ones, things are done within a few seconds once the queries are okay.
Once the database is in working order again, you can do a new video library export, and have all correct data in your nfo files.
So basically, this is the other-way-around method.


RE: Remove Genres After Editing NFO and Using SQL Server - FlashPan - 2021-08-14

(2021-08-14, 10:05)Karellen Wrote: Did you Refresh the nfo files into the library?

An easier way would be to install the Metadata addon and edit the genres in Kodi. Then you can run an Export to Separate files to refresh your nfo files for backup purposes.

https://forum.kodi.tv/showthread.php?tid=349035
Settings>Add-ons>Install from repository>Program add-ons>Metadata Editor

Thanks Karellan,  Did I refresh?  If you mean editing the Source to none, not removing the content and changing the source back to Movies or TV Show.  Well I just tried that now on a test movie source and that wiped out my watched status.  Or did you mean somethign else?

I'll check out the addon but am thinking this is starting to get complicated.


RE: Remove Genres After Editing NFO and Using SQL Server - FlashPan - 2021-08-14

(2021-08-14, 10:43)Klojum Wrote:
(2021-08-14, 09:32)FlashPan Wrote:  

How "bad" are those incorrect names? Knowing SQL commands would be a time-saver for sure. (Always make a backup before you start hacking your database)
Hi Klojum,

The incorrect names need to be completely removed not editied from Kodi/SQL

I do run an automated backup of my sql and can restore quite easily.  The SQL command to remove genres directly is eluding me and my confidence though.

I have already batch edited all my nfo files to remove/change the genres I no longer want so I do not need to run a process to update them again or I would rescan and loose my watched status within Kodi.

Cheers


RE: Remove Genres After Editing NFO and Using SQL Server - Karellen - 2021-08-14

(2021-08-14, 11:42)FlashPan Wrote: Or did you mean somethign else?
The Refresh button (ignore arrow 2). Answer No when asked "local information found. Do you want to refresh from the internet"

Image


RE: Remove Genres After Editing NFO and Using SQL Server - FlashPan - 2021-08-14

(2021-08-14, 12:27)Karellen Wrote:
(2021-08-14, 11:42)FlashPan Wrote:  
The Refresh button (ignore arrow 2). Answer No when asked "local information found. Do you want to refresh from the internet"

Image
Ahh yes, am aware of that but I have hundreds of TV shows I would need to refresh in that way.

My current thought and hunting is for someway to backup the watched status, then run the usual - editing the Source to none, not removing the content and changing the source back to Movies or TV Show to force a rescan and then restore the watched stauts.

Cheers


RE: Remove Genres After Editing NFO and Using SQL Server - Karellen - 2021-08-14

(2021-08-14, 12:39)FlashPan Wrote: editing the Source to none, not removing the content and changing the source back to Movies or TV Show to force a rescan
That is not quite correct. You need to remove content, otherwise nothing changes. Kodi will ask Do you want to remove all items within this path from your library?. Select Yes

(2021-08-14, 12:39)FlashPan Wrote: My current thought and hunting is for someway to backup the watched status
Try this... https://kodi.tv/addons/matrix/service.watchedlist


RE: Remove Genres After Editing NFO and Using SQL Server - Klojum - 2021-08-14

(2021-08-14, 11:47)FlashPan Wrote: The incorrect names need to be completely removed not editied from Kodi/SQL
..
I have already batch edited all my nfo files to remove/change the genres I no longer want so I do not need to run a process to update them again or I would rescan and loose my watched status within Kodi.

Removal is pretty easy, and the changes are instant. No need for a total rescrape.
But as you already edited your NFO files and so on, it's your choice and database.

Losing your watch status will not happen if enable the watch/resume status support in the advancedsettings.xml file, and do a library export. You'll have to change your genre stuff in the nfo files again, though.


RE: Remove Genres After Editing NFO and Using SQL Server - FlashPan - 2021-08-14

(2021-08-14, 12:51)Karellen Wrote:
(2021-08-14, 12:39)FlashPan Wrote:  
Try this... https://kodi.tv/addons/matrix/service.watchedlist

All done,

Thanks every one for your help and support.

I did it this way: Running WatchedList addon to a local DB, Editing the Source to none, and removing the content when prompted, Changing the source back to Movies or TV Show to force a rescan, rerun the WatchedList addon to restore the watched status.

Am a very happy (and kodi clean) bunny.  

Cheers!


Remove Genres After Editing NFO and Using SQL Server - Klojum - 2021-08-15

Thread marked solved.