View Single Post
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