Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
Migrate from flat folder structure for Movies
#1
Hi !

As the title says, I'd like to migrate from my current "flat folder structure" (movies) to the "1 movie = 1 folder" structure.
I already have a batch file that can auto create folder based on filename and move the file into it's folder.
Now I'd like to know if there is any way in Kodi not to have to scrape everything again from scratch (meaning re-downloading all artworks and movie infos) once I have moved every movie file in it's folder ?
Do I have to do something before moving files ?

Thx in advance.
Reply
#2
The location of the file is part of the scraping process, and is stored in the database along with pointers to the artwork etc.

So your options are either editing the database (wiki) for every entry and updating the location of the media file therein, or just scraping again.

The latter is probably quicker unless you're very comfortable with database manipulation (and even if you are, back-up first). Indeed we normally strongly recommend not touching the db manually unless you really know what you're doing.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#3
(2019-11-01, 13:36)NeBouse Wrote: Now I'd like to know if there is any way in Kodi not to have to scrape everything again from scratch
Yes. Export your library to NFO Files. See guide here... https://kodi.wiki/view/Import-export_library
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#4
(2019-11-01, 17:46)Karellen Wrote:
(2019-11-01, 13:36)NeBouse Wrote: Now I'd like to know if there is any way in Kodi not to have to scrape everything again from scratch
Yes. Export your library to NFO Files. See guide here... https://kodi.wiki/view/Import-export_library  
Ok, many thanks for your answer.
So basically, and if I understood everything correctly :

- First I need to export my database using the "separate files" option, in order to create a .nfo file for each movie.
- Run my batch file to create folders and move .mkv files in each corresponding folder.
- Manually move each .nfo file to its corresponding folder. (now that I think of it, the batch file may also move the .nfo file in the corresponding folder).
- Do a library clean-up
- Do a library update

Am I right ?

One last question: should I export Thumbnails, Fanart and Actor thumbs ? or Kodi will recreate its cache from the links found in the .nfo files ?
Reply
#5
(2019-11-01, 20:17)NeBouse Wrote: - First I need to export my database using the "separate files" option, in order to create a .nfo file for each movie.
- Run my batch file to create folders and move .mkv files in each corresponding folder.
- Manually move each .nfo file to its corresponding folder. (now that I think of it, the batch file may also move the .nfo file in the corresponding folder).
Yes.

(2019-11-01, 20:17)NeBouse Wrote: - Do a library clean-up
For such a major change to your library, I would recommend starting fresh otherwise your artwork cache will instantly double in size, and your database will be full of unwanted entries. If using Windows delete (or rename) the \roaming\Kodi folder, restart Kodi and a new userdata folder will be created. This will act like a fresh install, and you will need to add back whatever addons you had installed.

(2019-11-01, 20:17)NeBouse Wrote: - Do a library update
Yes


(2019-11-01, 20:17)NeBouse Wrote: One last question: should I export Thumbnails, Fanart and Actor thumbs ? or Kodi will recreate its cache from the links found in the .nfo files ?
Lots of variables to properly answer this question and depends on how you initially populated the library.
- Do you have local artwork already? If yes, then do not export artwork
- Did you use nfo file generated by a media manager to initially populate the library? (sounds like you did not) If yes, then you most likely won't have artwork links so no artwork will be downloaded. But you can easily check by opening an nfo file and looking for artwork links
- Do you have the advancedsettings entries to not modify cached artwork? If yes, then you can export your artwork if the above two points do not affect you. If you don't have the setting, you can still export artwork but it will be a reduced quality.
https://kodi.wiki/view/Advancedsettings....ry_artwork
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#6
(2019-11-01, 21:26)Karellen Wrote:  
(2019-11-01, 21:26)Karellen Wrote:
(2019-11-01, 20:17)NeBouse Wrote: - Do a library clean-up
For such a major change to your library, I would recommend starting fresh otherwise your artwork cache will instantly double in size, and your database will be full of unwanted entries. If using Windows delete (or rename) the \roaming\Kodi folder, restart Kodi and a new userdata folder will be created. This will act like a fresh install, and you will need to add back whatever addons you had installed.   
No i'm on Pi, but i can easily access the userdata folder.
I'm not really hot on deleting/renaming the whole folder since I have a few addons that took me time to configure (home automation, cinemavision, Hyperion and so on..)
Can I just delete the video database (.db file) and the Thumbnails folder ? is it enough ?
(2019-11-01, 21:26)Karellen Wrote: Lots of variables to properly answer this question and depends on how you initially populated the library.
- Do you have local artwork already? If yes, then do not export artwork
- Did you use nfo file generated by a media manager to initially populate the library? (sounds like you did not) If yes, then you most likely won't have artwork links so no artwork will be downloaded. But you can easily check by opening an nfo file and looking for artwork links
- Do you have the advancedsettings entries to not modify cached artwork? If yes, then you can export your artwork if the above two points do not affect you. If you don't have the setting, you can still export artwork but it will be a reduced quality.
https://kodi.wiki/view/Advancedsettings....ry_artwork 
No local artwork at all, everything has been scraped from online services (with the default scraper for fanarts and Artwork beef for clearlogos).
This has been done recently (following a mistake from me) from scratch that's why I'm a bit reluctant to start once again from scratch ahah.
Also nothing in the AdvancedSettings.xml related to artworks resolutions.
So not exporting artwork seems to be the best option for me.

I want to do all of this just to be able to use the reviving TvTunes addon, this will be the cherry on the cake of my setup.

Many thanks for your help btw, greatly appreciated !!
Reply
#7
(2019-11-01, 22:36)NeBouse Wrote: Can I just delete the video database (.db file) and the Thumbnails folder ? is it enough ?
Yep, deleting both of those items works also.

(2019-11-01, 22:36)NeBouse Wrote: Also nothing in the AdvancedSettings.xml related to artworks resolutions.
So not exporting artwork seems to be the best option for me.
Ok, then place those two entries into the advancedsettings.xml file, restart Kodi, then rebuild your library. This allows you to have full resolution artwork cached, which you can then export to your local folder. Should make it easier in future to rescan your library.

You are welcome Smile
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#8
@Karellen 

Just an update to say that it worked flawlessly (except for my clearlogos but I didn't configure Artwork Beef correctly, no big deal though).
Again, many thanks for your help.
Reply

Logout Mark Read Team Forum Stats Members Help
Migrate from flat folder structure for Movies0