Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 03-13-2018, 06:52 PM   #1471
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by nicolas161 View Post
, that helps a lot. If I understand correctly, you have already worked with database triggers, haven't you? If so, any advice on how one would implement something like this?
Advice? Take a backup of the database before you start.

I have written the trigger like this in the past. I'll have a look through some notes as I might have kept it. It has been discussed here, so a sample might have been posted. Other than that, the table you need to look at is called "Activity".
davidfor is offline   Reply With Quote
Old 03-15-2018, 12:02 AM   #1472
Elaxon
Zealot
Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.Elaxon ought to be getting tired of karma fortunes by now.
 
Posts: 100
Karma: 224118
Join Date: Dec 2014
Device: Kobo H20 Aura
I was restoring read states and noticed that some books have the percentage but not the location but just at the beginning of the book? I noticed it says on the first page restore states for epubs. Does this mean kepub will not function with it and will not bring you to the same location you left of in the book?
Elaxon is offline   Reply With Quote
Advert
Old 03-17-2018, 06:24 AM   #1473
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by nicolas161 View Post
, that helps a lot. If I understand correctly, you have already worked with database triggers, haven't you? If so, any advice on how one would implement something like this?
This is an example I have for a trigger on the Activity table. This should keep the stats tile as the first one. As long as it gets updated by the system at least once a month, it will stay.
Code:
CREATE TRIGGER Activity_KeepTileFirst_UPDATE
AFTER UPDATE ON Activity
FOR EACH ROW
WHEN ( new.Type = 'GlobalStats')
BEGIN
UPDATE Activity
SET Date    = datetime(Date,'+1 month')
WHERE rowid = new.rowid;
END
It has been a while since I tried this. It should work, but I have vague memory that there is a problem with it.
davidfor is offline   Reply With Quote
Old 03-18-2018, 10:04 PM   #1474
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Elaxon View Post
I was restoring read states and noticed that some books have the percentage but not the location but just at the beginning of the book? I noticed it says on the first page restore states for epubs. Does this mean kepub will not function with it and will not bring you to the same location you left of in the book?
Where are you seeing that it goes to the beginning of the book? Are you looking at the stored location id, or when you open the book after restoring the reading status?

It should work for sideloaded epubs and kepubs. I have to admit I don't use the restore very often, but it worked the last time I did try. The last time I did a big lot was just before Christmas as I was changing which of my ereaders I was going to use daily. That was for a about 100 books and they all seemed to be OK.

For purchased kepubs, it should work, but you might never see it. When you open a purchased kepub, it attempts to retrieve the current status from the server. If there is an update, it will prompt you to use this. And during a sync, it will quietly replace the status. I don't remember if I ever tried this.
davidfor is offline   Reply With Quote
Old 03-19-2018, 05:15 PM   #1475
ItalianUruguayan
Connoisseur
ItalianUruguayan makes transoceanic flights without the assistance of an airplaneItalianUruguayan makes transoceanic flights without the assistance of an airplaneItalianUruguayan makes transoceanic flights without the assistance of an airplaneItalianUruguayan makes transoceanic flights without the assistance of an airplaneItalianUruguayan makes transoceanic flights without the assistance of an airplaneItalianUruguayan makes transoceanic flights without the assistance of an airplaneItalianUruguayan makes transoceanic flights without the assistance of an airplaneItalianUruguayan makes transoceanic flights without the assistance of an airplaneItalianUruguayan makes transoceanic flights without the assistance of an airplaneItalianUruguayan makes transoceanic flights without the assistance of an airplaneItalianUruguayan makes transoceanic flights without the assistance of an airplane
 
ItalianUruguayan's Avatar
 
Posts: 52
Karma: 55058
Join Date: Mar 2018
Location: Spain
Device: Kobo Glo HD
Quote:
Originally Posted by davidfor View Post
This is an example I have for a trigger on the Activity table. This should keep the stats tile as the first one. As long as it gets updated by the system at least once a month, it will stay.
Code:
CREATE TRIGGER Activity_KeepTileFirst_UPDATE
AFTER UPDATE ON Activity
FOR EACH ROW
WHEN ( new.Type = 'GlobalStats')
BEGIN
UPDATE Activity
SET Date    = datetime(Date,'+1 month')
WHERE rowid = new.rowid;
END
It has been a while since I tried this. It should work, but I have vague memory that there is a problem with it.
Thanks a lot for this. If I wanted to keep the browser tile as the first one, how would I do it?

I have tried this, but it doesn't work:

Code:
CREATE TRIGGER Activity_KeepTileFirst_UPDATE
AFTER UPDATE ON Activity
FOR EACH ROW
WHEN ( new.Type = 'browser')
BEGIN
UPDATE Activity
SET Date    = datetime(Date,'+1 month')
WHERE rowid = new.rowid;
END
ItalianUruguayan is offline   Reply With Quote
Advert
Old 03-19-2018, 09:06 PM   #1476
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by ItalianUruguayan View Post
Thanks a lot for this. If I wanted to keep the browser tile as the first one, how would I do it?

I have tried this, but it doesn't work:

Code:
CREATE TRIGGER Activity_KeepTileFirst_UPDATE
AFTER UPDATE ON Activity
FOR EACH ROW
WHEN ( new.Type = 'browser')
BEGIN
UPDATE Activity
SET Date    = datetime(Date,'+1 month')
WHERE rowid = new.rowid;
END
You need to look at the Activity table and find the entry for the browser. The value in the "Type" column should be obvious. In this case, I think it is "Browser". And the case is important.
davidfor is offline   Reply With Quote
Old 04-14-2018, 03:23 AM   #1477
Cootey
Absentminded Reader
Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.
 
Cootey's Avatar
 
Posts: 1,104
Karma: 6463851
Join Date: Apr 2017
Device: Kobo Mini, Clara HD, Elipsa; Kindle Paperwhite 3 & 4; iOS eReader apps
It's a great tool. Thanks for writing it, davidfor.

I was experimenting tonight. I first checked the database. I also backed it up. I also side loaded a book through Calibre. Then I ran Order Series Shelves. I fetched the shelves and removed one that I wasn't using. Then I ejected my KA1 LE to see the changes. I immediately noticed that dozens of books had been removed from their collections. They're still on the device, but no longer associated with the collections I chose. My iPad collections remained unchanged. At this point, the KA1 and the iPad Kobo app are not in sync. Also, the shelf I removed came back on my KA1 and iPad. This last one was likely because Calibre forced it back on, so I've removed the shelf from Calibre. But do you know of an easy fix to get the two devices to sync their collections again?

One way is to log out of my KA1 and log back in. This will reinitialize the database which seems to be corrupt now. What do you think?

Last edited by Cootey; 04-14-2018 at 03:44 AM. Reason: more info
Cootey is offline   Reply With Quote
Old 04-14-2018, 09:51 AM   #1478
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Cootey View Post
It's a great tool. Thanks for writing it, davidfor.

I was experimenting tonight. I first checked the database. I also backed it up. I also side loaded a book through Calibre. Then I ran Order Series Shelves. I fetched the shelves and removed one that I wasn't using. Then I ejected my KA1 LE to see the changes. I immediately noticed that dozens of books had been removed from their collections. They're still on the device, but no longer associated with the collections I chose. My iPad collections remained unchanged. At this point, the KA1 and the iPad Kobo app are not in sync. Also, the shelf I removed came back on my KA1 and iPad. This last one was likely because Calibre forced it back on, so I've removed the shelf from Calibre. But do you know of an easy fix to get the two devices to sync their collections again?
Using the order shelves function shouldn't affect the books on a collection. It should just change a timestamp in the database.

For books to disappear from a collection, one of the following has to happen:
Code:
Manually remove the book using the device.
Change to collections column definition in the calibre driver.
Changes in the values in the collections columns.
Changes made on other devices/apps logged into the same account and synced.
Usually, it's the third option that strikes, but, you need to check.

Having multiple devices and apps can cause a problem. Plug a device in and let calibre do the collections. Sync via the server to the other device and plug that in. Calibre will do the collections again and might delete some if that device doesn't have the same books. Having the app around just adds an extra place for collections to be created and maybe conflict with what is happening elsewhere.
Quote:
One way is to log out of my KA1 and log back in. This will reinitialize the database which seems to be corrupt now. What do you think?
If the database on the device is corrupt, then you need to do something like this to fix it. Otherwise, syncing the devices and apps should bring the collections in to line.
davidfor is offline   Reply With Quote
Old 04-14-2018, 03:00 PM   #1479
Cootey
Absentminded Reader
Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.
 
Cootey's Avatar
 
Posts: 1,104
Karma: 6463851
Join Date: Apr 2017
Device: Kobo Mini, Clara HD, Elipsa; Kindle Paperwhite 3 & 4; iOS eReader apps
Quote:
Originally Posted by davidfor View Post
If the database on the device is corrupt, then you need to do something like this to fix it. Otherwise, syncing the devices and apps should bring the collections in to line.
Thanks for the detailed reply. I have no idea why the actions above affected my collections, nor which one was the culprit. They shouldn’t have. Since syncing wasn’t working (as I stated, the device and app were out of sync) I ended up logging out and setting the KA1 as a new device.

Completely unrelated to your tool, but it’s interesting that the sideloaded books remain on a reset. The new setup has no idea where to put them anymore, but at least I don’t have to copy them over again.

I didn’t realize your tool made backups until last night. If I had restored the backup manually, would that have fixed my corrupt collections database?
Cootey is offline   Reply With Quote
Old 04-15-2018, 03:53 AM   #1480
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Cootey View Post
Thanks for the detailed reply. I have no idea why the actions above affected my collections, nor which one was the culprit. They shouldn’t have. Since syncing wasn’t working (as I stated, the device and app were out of sync) I ended up logging out and setting the KA1 as a new device.
It sounds like the database was broken enough that this would have been the only way to fix it.
Quote:
Completely unrelated to your tool, but it’s interesting that the sideloaded books remain on a reset. The new setup has no idea where to put them anymore, but at least I don’t have to copy them over again.
Signing out of the account only touches the Kobo stuff. It removes all the downloaded books, the covers and resets the database. The sideloaded books aren't touched and are reloaded once you have signed in again. The collections names are synced from the server, and the downloaded books will be in collections. But, the collections status for sideloaded books are not synced, so they don't get put back into the collections.
Quote:
I didn’t realize your tool made backups until last night. If I had restored the backup manually, would that have fixed my corrupt collections database?
It should be OK. If you have a recent valid backup, restoring it should fix it.
davidfor is offline   Reply With Quote
Old 04-16-2018, 07:07 AM   #1481
Cootey
Absentminded Reader
Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.
 
Cootey's Avatar
 
Posts: 1,104
Karma: 6463851
Join Date: Apr 2017
Device: Kobo Mini, Clara HD, Elipsa; Kindle Paperwhite 3 & 4; iOS eReader apps
Quote:
Originally Posted by davidfor View Post
It sounds like the database was broken enough that this would have been the only way to fix it.

Signing out of the account only touches the Kobo stuff. It removes all the downloaded books, the covers and resets the database. The sideloaded books aren't touched and are reloaded once you have signed in again. The collections names are synced from the server, and the downloaded books will be in collections. But, the collections status for sideloaded books are not synced, so they don't get put back into the collections.


It should be OK. If you have a recent valid backup, restoring it should fix it.
As an update, I don't think any of this problem was caused by your plugin as I originally feared. Books disappeared from collections again yesterday, and my KA1 LE wasn't anywhere near Calibre. I've manually fixed all the collections now, then added some new books, so things seem OK, but I still don't understand why or how it happened, so I can't prevent it from happening again.
Cootey is offline   Reply With Quote
Old 04-16-2018, 03:06 PM   #1482
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,162
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Are you managing collections on both the Kobo and in calibre?
PeterT is offline   Reply With Quote
Old 04-17-2018, 12:40 AM   #1483
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
@Cootey: The question that PeterT asks is important as each time you connect, calibre will do the collection management. Also, are the books that are disappearing from collections purchased kepubs or sideloaded books?
davidfor is offline   Reply With Quote
Old 04-17-2018, 01:10 AM   #1484
Cootey
Absentminded Reader
Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.
 
Cootey's Avatar
 
Posts: 1,104
Karma: 6463851
Join Date: Apr 2017
Device: Kobo Mini, Clara HD, Elipsa; Kindle Paperwhite 3 & 4; iOS eReader apps
Quote:
Originally Posted by PeterT View Post
Are you managing collections on both the Kobo and in calibre?
No. I haven't had time to dig into calibre. It's got a steep learning curve, and I'm too busy. Just managing collections on my devices.
Cootey is offline   Reply With Quote
Old 04-17-2018, 01:14 AM   #1485
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Cootey View Post
No. I haven't had time to dig into calibre. It's got a steep learning curve, and I'm too busy. Just managing collections on my devices.
Then go into the driver configuration and turn off the collection management options. Do it either from the devices button when the device is connected or the Kobo Utilities button to make sure you get the correct driver.
davidfor is offline   Reply With Quote
Reply

Tags
kobo, kobo utilities


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Manga plugin mastertea Plugins 6 01-06-2022 02:43 AM
[GUI Plugin] Save Virtual Libraries To Column (GUI) chaley Plugins 14 04-04-2021 05:25 AM
Kobo Utilities Plugin Question nikev Kobo Reader 10 09-25-2018 11:55 PM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 04:37 AM.


MobileRead.com is a privately owned, operated and funded community.