![]() |
#1 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Choosing a screensaver cover
I don't know why I haven't thought of this before, but while answering this post, I realised it was a way of selecting a screensaver other than the current book.
The screensaver used for sleep and power off is the cover image from the most recently opened book that is not finished. That means it is usually the cover for the book you are reading, but, if the time of the device is changed, it can be from another book. This means that if you want to set the cover to something other than the current book, you can:
After that, the cover for the book selected will be used until you get to the future time you used. Or if you open the book used for the screensaver. The problems I can think with this are:
|
![]() |
![]() |
![]() |
#2 |
Librarian
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 346
Karma: 72225
Join Date: Apr 2015
Location: Liège - Belgium
Device: kobo gloHD - KA1
|
Hi !
This is great news for the H2O and 3.15.0 where screensaver hack doesn’t rely on a sleeping message anymore but more or less on a message error... Could you tell more on the where i could set time and im_reading status for an image in the database ? (i promise, i will use it at my own risk ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
If you have any relational database knowledge this isn't hard. And if you take a copy of the database before starting, you can put it back if you mess up.
The database is the file KoboReader.sqlite in the .kobo directory. The table "content" contains the details of the books. The rows with "contentType=6" are the books. These are your books and the recommendations from Kobo. The "ContentID" is the key. For sideloaded books, this is the URI used to locate the file when the device is running. The MimeType is the type of book. As your are interested in using an images as a cover, then looking for "MimeType='application/x-cbz'" will find the images. The values you want to change are in "ReadingStatus". Set this to 1. (0=Unread, 2=Finished). And the timestamp is in "DateLastRead". If you looked at the image using the device, this will be set and the change needed will be obvious. |
![]() |
![]() |
![]() |
#4 |
Librarian
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 346
Karma: 72225
Join Date: Apr 2015
Location: Liège - Belgium
Device: kobo gloHD - KA1
|
I’m a (lazy) oracle manager then i hope i could do with a sqllite database
![]() ![]() Edit : it worked well when I try it 2 days ago but touching the image restore it (obviously) to its normal state and the kobo firmware which display continuously the collection or the library by «*recent*» does not help. It should indeed be great to add this to KoboUtilities with a menu «*set this image as screensaver*». Anyway, the idea is so simple, you’re a genius to had point it out. Last edited by cramoisi; 06-05-2015 at 11:21 AM. Reason: tried and succeed |
![]() |
![]() |
![]() |
#5 |
Librarian
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 346
Karma: 72225
Join Date: Apr 2015
Location: Liège - Belgium
Device: kobo gloHD - KA1
|
Hi !
@Davidfor : What do you think of something like that ? Code:
create trigger myscreensaver after insert on content for each row when ContentID like '%screensaver%' and ContentType = '9' and MimeType = 'application/x-cbz' and BookID like '%screensaver%’ BEGIN -- reseting all screensaver as read update content set DateLastRead = '2015-01-01T12:00:00Z', ReadStatus = '2' where ContentID like '%screensaver%' and ContentType = '6' and MimeType = 'application/x-cbz' and BookID is null; -- set the read image as a screensaver update content set DateLastRead = '2032-01-01T12:00:00Z', ReadStatus = '1' where ContentID = new.BookID and ChapterIDBookmarked = new.ContentID and ContentType = ‘6’ and ContentID like '%screensaver%’; END The idea is to set a screensaver only by «*read it*» on the kobo. I’m not fond of adding triggers to a database, though (but i prefer that to add script which read endlessly a log file). Didn’t test it yet, was only thinking during lunchtime. Last edited by cramoisi; 06-15-2015 at 08:51 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Linux User
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,282
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
|
Hmmm, triggers are interesting. Don't think I ever used them before, not with SQLite in any case. Did you try it? Does it slow database updates down much? (There are lots of inserts when you add books to your reader.)
|
![]() |
![]() |
![]() |
#7 |
Librarian
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 346
Karma: 72225
Join Date: Apr 2015
Location: Liège - Belgium
Device: kobo gloHD - KA1
|
I didn’t try it yet (i’m at the office). I do a lot of triggers on the oracle database for the library where I’m working. But sqlite triggers are much more restrictive than the oracle one. (no ‘if', no possibility of changing the ‘new’ value,...).
Here I assume (but I’m perhaps wrong) that when I open an image, a line ContentType = ‘9’ of this image is created. On the creation of this line, I update the images data. The question about slowing the database is a good one. The code itself should not trigger if the 'when conditions' are not met (which is only for screensaver images, etc.) but the trigger will trigger... EDIT : rapid test and doesn’t work... Prevent the kobo from updating. ![]() Last edited by cramoisi; 06-15-2015 at 09:11 AM. |
![]() |
![]() |
![]() |
#8 |
Librarian
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 346
Karma: 72225
Join Date: Apr 2015
Location: Liège - Belgium
Device: kobo gloHD - KA1
|
To be tested. A lot less dangerous than the previous one. Prefer not to mess with trigger on the content table
Code:
-- add a image named screensaver% to screensaver when added into screensaver -- collection -------------------------------------------- create trigger add_screensaver -- if an image is added again, the trigger should be an update one after insert on ShelfContent for each row when new.ShelfName = 'screensaver’ and new.ContentID like '%screensaver%' BEGIN update content set DateLastRead = '2032-01-01T12:00:00Z', ReadStatus = '1' where ContentID = new.ContentID and ContentType = '6'; END -------------------------------------------- -- delete the screensaver after remove the file from the collection -------------------------------------------- create trigger delete_screensaver after update _IsDeleted on ShelfContent for each row when new._IsDeleted = true and old._IsDeleted = false and old.ShelfName = 'screensaver’ and old.ContentID like '%screensaver%' BEGIN update content set DateLastRead = '2015-01-01T12:00:00Z', ReadStatus = ‘2' where ContentID = old.ContentID and ContentType = '6'; END -------------------------------------------- -- adding again -------------------------------------------- create trigger addagain_screensaver after update _IsDeleted on ShelfContent for each row when new._IsDeleted = false and old._IsDeleted = true and new.ShelfName = 'screensaver’ and new.ContentID like '%screensaver%' BEGIN update content set DateLastRead = '2030-01-01T12:00:00Z', ReadStatus = ‘1' where ContentID = new.ContentID and ContentType = '6'; END -- when removed from a collection, the line stays but _isDeleted is true -- hence, an update trigger should do the trick for deleting and adding again Another way - without triggering on insert - would be to insert in advance the contentid with a isDisable=false and use only update triggers Last edited by cramoisi; 06-15-2015 at 11:26 AM. |
![]() |
![]() |
![]() |
#9 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Yes, the shelves is probably safer. It also has the advantage that you can still look at images that you don't want to use as the screensaver.
If you do it via the content table, it needs to be on update of the contentType=6 row for the image. The contentType=9 is created when the image is processed into the database and not change later. For some of the other book types, these rows get changed as the book is read. |
![]() |
![]() |
![]() |
#10 |
Librarian
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 346
Karma: 72225
Join Date: Apr 2015
Location: Liège - Belgium
Device: kobo gloHD - KA1
|
I will do it with the shelves it’s a more librarian way
![]() I tried with contentType=6 etc, but it turns out to be a loop as I need to update all image before updating the chosen one at 2030, 1. Hence updating the others triggers the trigger and all images are updated. Couldn’t do it without the possibility of alter the trigger or change the new value, which is not permitted. Thanks for your advices! EDIT : firsts tests are ok, moving it in dev corner. Last edited by cramoisi; 06-16-2015 at 07:37 AM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Choosing a cover (too quickly) | MSWallack | Calibre | 5 | 10-10-2012 10:01 AM |
cover book as screensaver | xfiles | Kindle Developer's Corner | 3 | 09-10-2012 11:47 PM |
Hacks Book Cover Screensaver | kleinste | Amazon Kindle | 10 | 05-25-2012 07:54 PM |
Idea for book cover screensaver | JohnsonZA | Kindle Developer's Corner | 3 | 10-28-2010 12:20 PM |
Book Title/Cover as Screensaver | mrgoodkat | OpenInkpot | 5 | 11-19-2009 01:28 PM |