Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 06-01-2015, 08:18 PM   #1
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,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:
  1. Set the time on the device to somewhere in the future.
  2. Open the book with the cover you want to use for the screensaver.
  3. Close the book without finishing it.
  4. Set the time correctly.

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:
  • The book chosen above will always be the first when you sort the library in "Recent books" order.
  • Don't use a purchased kepub for this. It should work, but the syncing will keep putting the book on the home screen. And I think there might be some other side affects.
  • You can't use a single image. As they are only one "page", they are marked as finished when you open them. There is a way to beat this if you want to edit the database. And I might add function in the utilities plugin to do this.
davidfor is offline   Reply With Quote
Old 06-03-2015, 04:23 AM   #2
cramoisi
Librarian
cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.
 
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 )
cramoisi is offline   Reply With Quote
Advert
Old 06-03-2015, 09:11 AM   #3
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,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.
davidfor is offline   Reply With Quote
Old 06-03-2015, 09:13 AM   #4
cramoisi
Librarian
cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.
 
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 Anyway, I got all I needed ! Thanks a lot


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
cramoisi is offline   Reply With Quote
Old 06-15-2015, 07:46 AM   #5
cramoisi
Librarian
cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.
 
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
Assuming all my images are in /screensaver/ named screensaver1..5.png.
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.
cramoisi is offline   Reply With Quote
Advert
Old 06-15-2015, 07:51 AM   #6
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
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.)
frostschutz is offline   Reply With Quote
Old 06-15-2015, 08:15 AM   #7
cramoisi
Librarian
cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.
 
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. I need to test what happen in the database when an image is added and what happen when it is opened. I don’t think the trigger on insert is a good idea, anyway. Would be better on after update if this could be achieved but without the possibility to change new value and/or deactivate a trigger, it turns to be a loop...

Last edited by cramoisi; 06-15-2015 at 09:11 AM.
cramoisi is offline   Reply With Quote
Old 06-15-2015, 09:55 AM   #8
cramoisi
Librarian
cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.
 
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
If this one works, it should have no impact on the updating process
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.
cramoisi is offline   Reply With Quote
Old 06-15-2015, 10:45 AM   #9
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,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.
davidfor is offline   Reply With Quote
Old 06-15-2015, 11:17 AM   #10
cramoisi
Librarian
cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.
 
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 The only downside is the need to remember that the shelve has to have only one item (I don’t know what will happen if two images have the same LastReadDate and ReadStatus).

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.
cramoisi is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 07:33 AM.


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