Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
About "Export to single file," search/replace path names in sources, and image paths
#1
I wanted to update my Fire TV Stick 4K to use some different paths in my video sources, so I had Kodi 18.5 export to a single file. I was aware of the artwork issue, which is still documented below to cause the artwork to point to local files (see section 4, "Why 'multiple files' and not single-file export?," which you have to expand):

https://kodi.wiki/view/HOW-TO:Backup_the_video_library

I'm happy to report the exported XML file did NOT exhibit this issue, and the artwork was all Internet URLs. I assumed Kodi wouldn't be able to find the cached artwork for the changed video file paths, so I deleted the thumbnails. After deleting the video database and importing from XML, Kodi redownloaded all the artwork, and everything turned out fine. Just what I wanted.

So this documentation appears to be out of date. In addition, it says in Part 4, "Alternatively, you could do a single-file export without exporting images..." I did this a second time just to check, and there was no way to carry this out. Kodi exported all the images anyway, and there was no option not to do this, which from what I can tell, is completely pointless, because the exported XML file doesn't reference them. Also, assuming things worked as documented, I don't know why anyone want to enter the state, "Once the images are cached/saved locally on each Kodi device, the exported image copies are only used if something happens to the local copies," which implies you may need to keep those local copies created by the export, because Kodi remembers them.

Can anyone clarify what's going on here and how this is intended to work?
Reply
#2
(2019-12-01, 06:35)crawfish Wrote: because the exported XML file doesn't reference them.
It wouldn't. Local artwork is never referenced in export files.

(2019-12-01, 06:35)crawfish Wrote: I don't know why anyone want to enter the state, "Once the images are cached/saved locally on each Kodi device, the exported image copies are only used if something happens to the local copies," which implies you may need to keep those local copies created by the export, because Kodi remembers them.
I don't really understand what you are saying here. Where is that quote from? It is not on that page you linked to.
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
#3
As posted, "see section 4, "Why 'multiple files' and not single-file export?," which you have to expand."
Reply
#4
All I can say is that the page is very outdated. I don't even know why the page version was bumped to v17, as some of the info on the page does not apply to v17 or v18.

2000+ pages on the wiki and only two contributors makes it a certainty that most pages will be outdated unless others start chipping into this community supported wiki.
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
#5
Cool. My main question is about the behavior, which is new to me. I did a web search before posting and didn't find any similar discussion, except about the local image paths throwing a wrench into the process. I'm quite sure I tried this a few years ago and decided against it because I did indeed find local image paths in the exported XML file. On my PC, also running 18.5, I just exported to single file, and the XML file's thumb paths are all Internet URLs. Even so, Kodi created folders for "actors, movies, musicvideos, and tvshows" and filled them with over half a gigabyte of artwork it can't possibly use. So in addition to the behavior changing in a positive way, Kodi is still pointlessly supporting the old undesirable way. (It took a lot longer for my Fire Stick to download those files than my PC to create them. lol)
Reply
#6
I'll try to find some time in the coming weeks to update that page as I regard it as a basic and essential page.

What makes you believe the exported artwork is not being used?
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
#7
The exported XML file contains no references to the local artwork. The XML file contains only Internet URLs for the artwork. The XML file is what you import.
Reply
#8
(2019-12-01, 08:11)crawfish Wrote: The exported XML file contains no references to the local artwork
It is not supposed to contain references to local. What would be the point of that? It is local, so the scanner will pick up the local artwork in just the same way it picks up the local xml file.

The internet URL's are a backup in the event the local artwork is missing or corrupted, then Kodi knows where to find a replacement.
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
#9
I guess I'm confused because Kodi used to put the artwork local path/filenames in the XML file, hence the warning in the Wiki and past discussions on the matter, such as here:

https://forum.kodi.tv/showthread.php?tid...pid1809026

Nowadays, there's no mapping in the XML file to the local files, so to find them when you import, Kodi would have to work, say, from the title, e.g. "x", and look for "movies/x-poster.jpg", and further assume that "movies" is located in whatever folder contained the XML file. IOW, when you import, it would have to use the location of the XML file and the info that is available in the XML file to work backwards to derive the directory structure and naming it generated from the database files when you exported. If it works that way, great, but I would hope you could just delete everything once you've completed the import. However, the (outdated) wiki states they can still be used long after you've completed the import, which implies it's somehow remembering the location you imported the XML file from, and that seems like a very strange thing to do.

Also, it would be good to know if the old thumbs in userdata survive after the source paths have been changed, which was the purpose of my export/import. Like I said, I deleted the thumbs to avoid any chance of duplication, which is especially important on a device with as little storage as the Fire Stick 4K.
Reply
#10
It's a long time since I have looked at Single File Export. I'll have to re-familiarise myself with it. I use single file export regularly.

(2019-12-01, 08:55)crawfish Wrote: when you import, it would have to use the location of the XML file and the info that is available in the XML file to work backwards to derive the directory structure and naming it generated from the database files when you exported
Don't think of the export as a single xml file with other "stuff" exported along with it. The whole folder is the export. The xml file is just one component of it.

(2019-12-01, 08:55)crawfish Wrote: Also, it would be good to know if the old thumbs in userdata survive after the source paths have been changed,
If you are referring to the thumbnail cache then yes, they will still survive. Kodi does not delete anything from the cache, which is why it continues to grow over time, especially if you are rescraping the same titles. Rescrape a movie 4 times, and you have 4 times the artwork for the same show.

When I rewrite the wiki page, I will have better recall on exactly how it functions.
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
#11
Thanks, I should look at the source code to see what else I can learn. The bottom line is that "export to single file" worked perfectly for me, allowing me to rename source paths without losing my library. The problem is that the wiki and discussions I found heavily favor exporting to multiple files, and their admonitions appear to be based on considerations that no longer apply. I would have (and have in the past) rebuilt the library from scratch rather than dump all those jpg and nfo files alongside my media files, which happens with "export to multiple files." I'm so glad the single file export works!

For anyone who may stumble upon this, besides doing the export/import, I also modified the following files to fully carry out renaming source paths and changing SMB passwords.

advancedsettings.xml (added import settings to keep resume positions and played states, documented in the wiki)
mediasources.xml (changed NAS name, SMB passwords)
passwords.xml (changed paths, SMB passwords)
sources.xml (changed paths)

After the import had completed, I deleted the folder containing the exported XML library file and the artwork folders. I didn't see any reason to keep it around despite what else I read.

I'll mention again that besides deleting the MyVideos database before importing the XML file, I also deleted the userdata/Thumbnails directory and Textures database, because I was afraid the artwork would end up being duplicated. Apparently, this was the right thing to do.

P.S. To Karellen, there's another confusing wiki entry here:

https://kodi.wiki/view/Import-export_library/Video

This stuff is just wrong:

2.2 Single File

Note: Do not use this option if you have changed, or intend to change, the filenames or paths of your video files after running the Export. Doing so will leave you with a dead library. The data will be imported but Kodi will not be able to locate the moved files. Use the Separate files method instead.
...
Note: The Single File Export process changes the artwork location URL to the folder location of the export, which causes an issue if you need to refresh the image.
Reply

Logout Mark Read Team Forum Stats Members Help
About "Export to single file," search/replace path names in sources, and image paths0