Page 1 of 1

Library Update For Removable Devices

PostPosted: Fri Aug 23, 2013 9:49 pm
by anniebody
Using Serviio with no automatic updating for media on SATA drives on removable caddies means I have to manually force refresh every time the caddy is re-inserted. Serviio should check device availability before changing the library to nothing for a device that is not currenlty plugged in.

Re: Library Update For Removable Devices

PostPosted: Fri Aug 23, 2013 11:49 pm
by zip
That is not possible because unplugged state is the same as a removed folder / mount point. So to automatically remove deleted files this has to be done.

Re: Library Update For Removable Devices

PostPosted: Sat Aug 24, 2013 8:01 am
by nickski
This has been requested before http://forum.serviio.org/viewtopic.php?f=3&t=7227&hilit=nickski

It still catches me out occasionally - and it makes a nonsense of the "last added" function.

Its odd that Serviio only has the concept of "exists" or "doesn't exist" and can't conceive "offline"!

Re: Library Update For Removable Devices

PostPosted: Tue Oct 15, 2013 4:05 pm
by IronGibbet
Hi,

wouldn't it be possible to add an extra checkbox with a bool behind it after the "Scan for file additions and updates"? When it's a removable device check if the whole device is gone and for that time skip the updates for all folders on that drive/device.
In my case it takes a bit of time to readd about 1 TB of videodata three to four times a week.

Greetings IG

Re: Library Update For Removable Devices

PostPosted: Tue Jan 07, 2014 4:28 pm
by bobsmo
+1 for me as well here....still gets me every once in awhile.....can't it just be that when there is no regular library refresh ( so Keep Library Automatically Updated is NOT checked), it just does not do the check upon start up?

Re: Library Update For Removable Devices

PostPosted: Tue Jan 07, 2014 11:04 pm
by DenyAll
zip wrote:That is not possible because unplugged state is the same as a removed folder / mount point. So to automatically remove deleted files this has to be done.
In fear of treading in waters I know nothing about.... couldn't Serviio test for the existence of the root of the shared folder prior to commencing the scan of that individual shared folder and its subfolders (ie. the existence of the shared folder as it is listed in Serviio Console, Shared Folders), and if the folder does not exist, assume it has been unplugged and skip the scan (for this shared folder only) this time.

The concerns are:

  • that a permanently removed drive/deleted shared folder will never have its media removed from the library. This can be overcome if (and this may already be the case) all relevant library entries are removed when a shared folder is removed from the library ie. if the user permanently removes a drive/shared folder, they must also remove the shared folder from the library to also remove its entries;
  • users will still appear to be able to access media from their renderers (the browse function will still list the unavailable media I believe?). When they try and play the media it will fail - this may confuse some people (but no worse than having items disappear as is the case now).
  • if the drive is disconnected after the scan starts then the media will be removed (as is the case now).
Don't see that any of these negatives are insurmountable, but it does depend on java's ability to test for the existence of the shared folder prior to the scan. This scheme works on the theory/assumption that users won't normally physically delete a shared folder at its root (they may delete subfolders, but under this scheme cannot delete the root without also deleting it from the library).

Re: Library Update For Removable Devices

PostPosted: Thu Jan 09, 2014 5:45 am
by zip
So if your drive is under /mnt/drive I could check for /mnt but that will not tell me if the drive is attached or not. It would work on Windows, probably

Re: Library Update For Removable Devices

PostPosted: Thu Jan 09, 2014 6:16 am
by DenyAll
Not a linux user but if the shared folder was "/mnt/drive", couldn't you check for "/mnt/drive"? ie. check whatever the user has listed as the "root" of their share - if they share "/mnt/drive" then test at that level, if they nominate "/mnt/drive/folder/folder" as there shared folder, test at that level, etc.

Re: Library Update For Removable Devices

PostPosted: Mon Jan 13, 2014 5:23 am
by jsbbs
I'd be keen on this too!

I've mapped my NAS volumes as shared folders in serviio (my movies and pictures are scattered on devices and volumes for redundancy... after serviio, my next project will be a big unRAID server lol!).

When I turned off my NAS, serviio 'cleared' out the contents. And when I turned the NAS back on, serviio progressively re-added the movies and photos into its list. That wasn't good for the WAF (wife acceptance factor).

I concur with DenyAll's comments earlier and think that if the 'root' of the share doesn't exist, then skip the scan. Maybe even trick the client (media renderer) that there is no content available but don't remove any information from serviio's datastore.

If the user doesn't figure out that something's wrong, then the problem might be the user lol!

Re: Library Update For Removable Devices

PostPosted: Mon Jan 13, 2014 5:51 am
by zip
DenyAll wrote:Not a linux user but if the shared folder was "/mnt/drive", couldn't you check for "/mnt/drive"? ie. check whatever the user has listed as the "root" of their share - if they share "/mnt/drive" then test at that level, if they nominate "/mnt/drive/folder/folder" as there shared folder, test at that level, etc.

but then if you remove /mnt/drive/folder Serviio would not detect it as removed. Unless I add additional checkbox somewhere, which might make the UI even more confusing.

Re: Library Update For Removable Devices

PostPosted: Mon Jan 13, 2014 7:18 am
by DenyAll
zip wrote:but then if you remove /mnt/drive/folder Serviio would not detect it as removed.
Yes that's correct. The scheme relies on users not physically removing the folder on the HDD without also doing so in Serviio Console, Shared Folders. They could remove files and sub-folders as they do now, but cannot delete the main folder (as listed in the Shared Folders) without also removing it from the Shared Folder listing.

Realise that this scheme is a compromise - it relies on user behaviour which is never reliable :) - but I think it could present a way to support removable drives (albeit not perfect). I think that it would be rare that a user would delete/rename the main folder and also not the listing in the Shared Folder, but if they do, the impact is imo less than large sections of a library disappearing because a drive is temporarily off-line. A warning in the log could also be used to show where a shared folder is not found, and ignored in the library update.

Anyways, just an idea....

Re: Library Update For Removable Devices

PostPosted: Mon Feb 24, 2014 7:37 pm
by filjander
Can you manage that situation writing an hidden file in the root of shared folder? (obviously in folders with RW permissions) Something like a .serviio file, in the same way some software repositories do (live .svn or .git). Updater thread can check this file to identify a disconnected shared path.

Re: Library Update For Removable Devices

PostPosted: Mon Feb 24, 2014 8:46 pm
by zip
That would require to have write access, which is not always the case.

Re: Library Update For Removable Devices

PostPosted: Mon Feb 24, 2014 9:02 pm
by vbivona
This sounds complicated. How about this:

Serviio adds and removes items when it updates the library. Could you separate those functions similar to the way XBMC works. In XBMC, update video library just processes additions. Clean video library removes items that don't exist. If the functions were separate, I wouldn't lose my last added and watched items on a somewhat regular basis. Of course, I would have to make sure all disks are accessible before I use the clean library function. I could live with that.

The way things are right now, I frequently lose the flag that indicates the last TV episode in a series I've watched (and my last added list has become almost useless because it removes everything when the disk is not accessible then it adds them back).

Re: Library Update For Removable Devices

PostPosted: Mon Mar 03, 2014 6:51 pm
by filjander
zip wrote:That would require to have write access, which is not always the case.

Well, as I understand, the only actual procedure to use external hd and avoiding the library cleanup each time i disconnect those, is keeping refresh checkbox unchecked, then, every time i add a file, i need to select checkbox, save (this also triggers a library update) then, after update finished (as i can see from status popup), ri-deselect checkbox and save.

Is it possible at least to add a button to force refresh on every single mount point, without the whole checking/unchecking thing? Thanks.

Re: Library Update For Removable Devices

PostPosted: Wed Mar 05, 2014 5:23 pm
by Iveky
If I change data in (xbmc) nfo file, when they will reflect changes in database?
I pressed 'refresh' but still old name appears on tv?
how to force to reread data?

Re: Library Update For Removable Devices

PostPosted: Wed Mar 05, 2014 7:32 pm
by zip
Iveky wrote:If I change data in (xbmc) nfo file, when they will reflect changes in database?
I pressed 'refresh' but still old name appears on tv?
how to force to reread data?

It will work if you have the Check for updates of currently shared files selected.