Don't update if SOURCES missing
#1
Rainbow 
Hi guys,

I did a quick search and didn't see this logged, so please let me know if this has already been logged/addressed, and, of course, if you think this is just not required.

I like to automate updating the library and cleaning the library so I don't have to manually do it.

However, you can run into issues if using network shares for your sources, and Windows, for some reason, can't reconnect the shares (either on boot / coming out of suspend/sleep etc..).

If your sources are now down, xbmc can't get to them on start, and will update/clean your library accordingly (i.e. empty the database if you have update & clean on startup set).

What do you think about using the following process instead?

If update/clean libary on startup is enabled, but the added sources are not found, then do nothing.

Or preferably, notify the user that the sources are missing and ask if he/she wants to reset the library, or cancel the update/clean.

Or something to that effect.

Just as a safeguard against having to rebuild the database in case networked drives don't connect.

Your thoughts?
...DJVege...
HTPC: G840 + GT430 + 2GB RAM + 30GB SSD
Remote: iPad/iPhone + iRule + USB-UIRT // FireFly RF Remote
Software: XBMC Eden + Eventghost + Win7
Reply
#2
Love the idea. I use mapped network drives and it can be a pain to rebuild.
Image
Reply
#3
This is a problem for me too, but I'm not sure it's really XBMC's problem, how is XBMC supposed to know that you haven't simply deleted the directory?

I use sshfs to mount my remote shares (it's simple and just works in linux) and I've mitigated this problem by simply modifying my xbmc startup script to check for the existence of my tv and movie dirs (if they exist they're mounted) before launching xbmc. I'm sure that something similiar could be done on other platforms.
Reply
#4
Did a manual "clean library" this afternoon and now I am adding over 8,500 TV episodes and over 1800 Bluray movies back to my library. I wish something could be done to check before deleting all the entries. I couldn't believe it when I checked and everything was gone, never happened before and I didn't check to see if it could see the sources. Next time I will make sure before I do a clean library. I am using the "Live" build and for some reason unit lost it's connection to both my unRaid servers so everything was deleted.
Reply
#5
Yep a failsafe that detects, say, more than 5% of the library will be deleted and prompts the user to say 'are you sure you want to remove this much from your library - might indiciate a network error' - or similar, would be a great idea.

(But I suggest you implement automatic daily DB backups in the meantime, works a treat!)
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#6
bossanova808 Wrote:Yep a failsafe that detects, say, more than 5% of the library will be deleted and prompts the user to say 'are you sure you want to remove this much from your library - might indiciate a network error' - or similar, would be a great idea.

(But I suggest you implement automatic daily DB backups in the meantime, works a treat!)

exactly, or if it cannot navigate to the Core section
i.e. if D:\Movies as a source then It won't check D:\Movies\Iron Man (2006)
Image
Reply
#7
Quote:exactly, or if it cannot navigate to the Core section
i.e. if D:\Movies as a source then It won't check D:\Movies\Iron Man (2006)


This is the way to do it. Validate each source before starting cleaning.
Reply
#8
vikjon0 Wrote:This is the way to do it. Validate each source before starting cleaning.

Problem, what about those who use sickbead and have the advanced setting to clean on update?
what about those that Update on startup, with the same advanced setting?
Image
Reply
#9
Quote:Problem, what about those who use sickbead and have the advanced setting to clean on update?
what about those that Update on startup, with the same advanced setting?
What are you talking about?

We are talking about the problem that cleaning purge the library if the remote media file is offline.

The quickfix is to change the sb script to verify all sources before shoting but that does not cater for the server going down after the check of course.

EDIT: Obviously I do not expect you to validate the source MANUALLY. Maybe I am too much of an IT person but I assumed we were talking about fixing this in the computer? The work around "do not run cleaning when NAS is offline" is already in place Wink
Reply
#10
vikjon0 Wrote:What are you talking about?

We are talking about the problem that cleaning purge the library if the remote media file is offline.

The quickfix is to change the sb script to verify all sources before shoting but that does not cater for the server going down after the check of course.

EDIT: Obviously I do not expect you to validate the source MANUALLY. Maybe I am too much of an IT person but I assumed we were talking about fixing this in the computer? The work around "do not run cleaning when NAS is offline" is already in place Wink

I understand the not doing manually. Guess you have to know my settup.

But I have a Server that runs SickBeard, and hosts the media.
For individual Bedrooms in my home, They have their own library (everyone wants to know what they have watched as an individual).

I mapped Network Drives for each of the systems. Same Sources everything.

SickBeard sends an update request to all Clients on new shows (the guest room client is only on when guests are over) and updates them all.

The guest machine is set to update on startup (since offline most of the time)

My Server hosts the "Prime" data in case I do have to rebuild.

Each machine has the "Clean on Update" advanced setting.

Each Machine Starts XBMC automaticaly

here are the problems:

1) If I update to a new version of XBMC (whether Camelot to Dharma, or Dharma to Eden) ALL Mapped Drives are unreadable (Hence the update on startup problem)

2) Thanks to having many people using the internet getting their movies & TV Shows (Torrents, Filesharing Sites, p2p, ect.) the network traffic can clog the system where it can navigate to the folder, but latency is too high to scan. (has happened too many times, hence I ask what my roommates want and I do most of the downloading).

3) (Involving the guest machine in particular) Some machines may not register the mapped drives, and have to be navigated manually before a scan. The problem is that by the time I find out it hasn't done so its usually too late and the "prime" data has to be re-copied to fix the library.

these are real world examples of how this feature would be very useful, and solve A LOT of problems for the Advanced and Noob alike
Image
Reply
#11
Hmm... I was thinking more along the lines of a simple:

If SOURCE is missing, WARNING message displayed allowing the user to simply skip the source, or remove the source. This is because a SOURCE points to a directory with a bunch of files and folders. It is not likely that a bunch of files and folders within a source go missing unless you actually delete them/move them.

So I think the "warn the user if more than 5% is missing" option would probably be a bit much for this purpose. Of course, people could have a setup where this would also be useful, but I just can't think of one (coming from a windows setup background).

To summarise:

CleanonUpdate(){
ListSources()
for each source in ListSources(){
If source = unavailable/missing
Warning message();
}

etc...
}

Yes yes... my crappy attempt at the logic/code behind it. But you get what I mean! Smile
...DJVege...
HTPC: G840 + GT430 + 2GB RAM + 30GB SSD
Remote: iPad/iPhone + iRule + USB-UIRT // FireFly RF Remote
Software: XBMC Eden + Eventghost + Win7
Reply

Logout Mark Read Team Forum Stats Members Help
Don't update if SOURCES missing0