View Single Post
Old 02-04-2017, 08:53 PM   #50
kido.resuri
Groupie
kido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura aboutkido.resuri has a spectacular aura about
 
Posts: 172
Karma: 4282
Join Date: Dec 2016
Location: Hungary
Device: Kobo Aura H2O
So far, so good. I experimented with this method a bit.
First of all, let me explain (if it was not clear yet) why I want to update the database entries for virtual sd card library content.
- Content loaded from SD (let it be real or virtual) is only available while the SD is loaded. A vritual SD should be loaded on every boot for its content to be accessible anytime.
- When a real SD card is inserted while a virtual one exists, the virtual SD's loaded content should be removed from the library.
- Nickel must process the SD each time it is inserted (real or virtual), making it slow startup if the virtual is mounted on every boot (or whenever).
- Such content should loose it's Shelf (Collection) associations (I'm not sure about this at all).
That's why I'm trying to solve this somehow.
As mentioned before, and much earlier in other threads, nickel only reads from the database when it's starting. The update can be easily done with the sql triggers, but nickel will still use the original path, even more, it will use this path to access the database and load the required files - which won't work, as the trigger already updated the values. So currently a reboot is the only solution. Nickel adds an Event table entry after the content is added to the database. This could be used to detect the addition by nickel, but shell scripts can't be run from sql triggers, so there must be some kind of shell script written which queries the changes for each newly added book. Maybe someone else finds another, better method to wait for nickel to finish reading content from the virtual SD card.
kido.resuri is offline   Reply With Quote