Fix library cleanup
#1
"Clean library" should check if the path of the movies is in the sources, and if not just delete the movie entry from the database.

What happens now is:
Say you changed your nas name, or consolidated various smaller NAS'es into a bigger one and you edit your sources. kodi will now try forever to wake on lan the old sources because the path of the movies in the library points to them. This takes forever, and clean library will never finish and/or Kodi will crash. Since the old path of the files is removed from sources, Kodi should be smart enough to check for this and just delete the movies that have paths that aren't in the sources anymore.
Reply
#2
(2017-01-09, 11:01)Soli Wrote: kodi will now try forever to wake on lan the old sources
What about if you turn off the setting to wake remote servers?
Reply
#3
I'd rather have to delete things manually (eg in this case remove the source in the gui and use the clean library prompt) than have kodi delete stuff automatically without asking me. There might be good reasons why someone doesn't have a source listed in sources.xml - one example would be if they're using mysql and they've followed advice given a squillion times here to only add sources on 1 machine.
Reply
#4
You can setup the sources on each machine without a problem when using mysql. Just make sure you use the exact same path, if done correctly the content will already be set after adding it.
Reply
#5
(2017-01-09, 11:24)BigNoid Wrote: You can setup the sources on each machine without a problem when using mysql. Just make sure you use the exact same path, if done correctly the content will already be set after adding it.
I know you can - that's how I do it, in fact my sources.xml is identical across every platform (which took some doing).
What I'm saying is that there will be plenty of people who don't have that because they've followed advice from here to only keep sources.xml on 1 machine - which is fine, it works perfectly, but it wouldn't work with this proposed feature.
Reply
#6
Okay, not sure why anyone would be giving that advice Smile

Regards this feature request; why not do it the proper way and remove the source and add a new one? That way it will just clean everything that is not in sources.xml

EDIT:
You can export your library first into multiple files, add import watched state and resume points to advancedsettings.xml and all that is lost when importing is your bookmarks.
Reply
#7
(2017-01-09, 11:41)BigNoid Wrote: Okay, not sure why anyone would be giving that advice Smile
At a guess because there's less scope to make mistakes if you're not copying sources manually in the gui, and manipulating sources.xml with a text editor or copying / pasting is definitely frowned upon at least by some team members. Plus I guess it's just easier - one less thing to describe, one less step to follow and one less thing that can go wrong.
Quote:Regards this feature request; why not do it the proper way and remove the source and add a new one? That way it will just clean everything that is not in sources.xml
Is what I was trying to say in post #3.
Reply
#8
(2017-01-09, 11:07)bilgepump Wrote:
(2017-01-09, 11:01)Soli Wrote: kodi will now try forever to wake on lan the old sources
What about if you turn off the setting to wake remote servers?

If I turn that off (Which is hidden in power saver submenu, really?). The process of library cleanup will complete without Kodi locking up. It takes too long though. At the end of the process Kodi will warn about the unavailable server and ask if I want to remove the associated movies with that path.

The logistics of clean up process needs to be dealt with.

Maybe we need a hard clean than can be run manually, which pings the sources first, and if not available will remove any associated entried.

And a normal "soft clean", that will not remove entries associated with available servers (of course, if the server is found but the file is removed from the server, the associated entry should be removed regardless, just like normal).

In any case the dialogs regarding unavailable servers should not be at the end of the process? And do something about WOL, I shouldn't need to disable this just to clean my library.

I don't know what might be the ideal thing to do here,I just know it needs to improveWink
Reply
#9
(2017-01-09, 11:41)BigNoid Wrote: Okay, not sure why anyone would be giving that advice Smile

Regards this feature request; why not do it the proper way and remove the source and add a new one? That way it will just clean everything that is not in sources.xml

EDIT:
You can export your library first into multiple files, add import watched state and resume points to advancedsettings.xml and all that is lost when importing is your bookmarks.

Basically that is what I did. Kodi doesn't handle that well with WOL enabled. My new nas was empty so Kodi should have just deleted all movie entries, and it did at the end when I disabled WOL and asked me if I wanted to remove the entries associated with unavailable server...I had to answer yes numerous times because i had many sources. This was asked at the END of the process.. So something which should take 10seconds took forever.
Reply
#10
(2017-01-09, 20:51)Soli Wrote: In any case the dialogs regarding unavailable servers should not be at the end of the process?
When you clean the library, it goes through the library. It can't just announce what's there or not there, until it's gone through each of the sources and the library entries. If it announced what was there and not there as it went through each source, you'd need to either sit there, or keep coming back to it to get it to advance when it moved to the next source. Having it all at the end means you can go off and do other things and then tell the program what to do with the items for which it could not find the source all at one time. I'd find it annoying having to keep checking for a prompt as it hit each source, I prefer it the way it is. I don't want to try it because I don't know exactly what will happen, but when you remove the source, does it not ask you what you want to do with the files?
Reply
#11
You're right to some extent. Nobody wants to keep checking for a prompt.. but having the prompt come earlier doesn't neccesarily equal this.

The more I think about it, the more I think this should be automatic:
A) If the source is listed in sources.xml but not available, then do nothing.
B) If the source isn't listed in sources.xml but not available, delete the entry from the database

This will also fix unwanted prompts after Auto Library scanner/cleaner addon runs. It's happened that I've seen that prompt after turning on my TV. The wife children, or even myself could be choosing the wrong option for various reasons.

+ option to enable/disable WOL when cleaning, WOL timeout, and/or make it automatic : enable on scenario A, disabled at Scenario B.
Reply

Logout Mark Read Team Forum Stats Members Help
Fix library cleanup0