Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 05-11-2013, 06:49 AM   #1
psy65
Enthusiast
psy65 doesn't litterpsy65 doesn't litter
 
Posts: 28
Karma: 110
Join Date: Oct 2011
Device: kobo touch
modifying reading stats (number of books read and hours read)?

Hi

Recently I did a factory reset on my kobo and I lost my reading stats(number of book read and hours read.

I was wondering if there was any way to manually modify those numbers in a configuration file or in the database? I've looked at the database but it doesn't seem to be there so my guess is that these numbers are somewhere else!

Thank you
psy65 is offline   Reply With Quote
Old 05-11-2013, 07:06 AM   #2
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
The stats are stored in in the database. They are synced to the server for the purchased kepubs. But, for sideloaded books, they are purely in the database. It is in the Event table. Recreating them manually would be difficult as there are several rows per book that has been opened. And not all of the data is obvious. If you have a backup of the database from before reset, it probably would be possible to extract the data and load it into the new database.
davidfor is offline   Reply With Quote
Old 05-11-2013, 07:47 AM   #3
psy65
Enthusiast
psy65 doesn't litterpsy65 doesn't litter
 
Posts: 28
Karma: 110
Join Date: Oct 2011
Device: kobo touch
Quote:
Originally Posted by davidfor View Post
The stats are stored in in the database. They are synced to the server for the purchased kepubs. But, for sideloaded books, they are purely in the database. It is in the Event table. Recreating them manually would be difficult as there are several rows per book that has been opened. And not all of the data is obvious. If you have a backup of the database from before reset, it probably would be possible to extract the data and load it into the new database.
that's what I'm looking at now. It appears to be in the event table. Event number 46 seems to contain time red per book in minutes in the eventcount column and event number 5 seems to indicate a finished book. I'm pretty sure about the meaning of event 5 but not as much about event 46.

as you say it would probably be possible to transfer those 2 type of records from one database to another but it would not be that easy. then copying the whole table content would probably be easier.

If I find enough time,I might just try it this weekend

anyone ever tried this with success?

thanks
psy65 is offline   Reply With Quote
Old 05-11-2013, 09:04 AM   #4
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
I have spent a bit of time trying to work out the events. Below is what I have. Some of the events map to awards (table Achievement) through the Rules table. I have posted this before, but this is probably a good place for it to reside.

Code:
Id		Description
0		Sync with Kobo			- One for each book synced, but only when a new book is downloaded?	LastOccurence is updated
3		Open book
4		Started a digital library	- One for each kepub
5		Finished book
46		Turn page			- Event count = number of pages turned
47		Read all night
48		Read all night
63
80 		Page Turner ("Read two hours straight")
1001	Read 12am-1am
1002	Read 1am-5am
1004	Read 7am-9am
1005	Read 9am-12am
1006	Read 12pm-2pm
1007	Read 2pm-4pm
1008	Read 4pm-6pm
1009	Read 6pm-8pm
1010	Read 8pm-10pm
1011	Read 10pm-12pm
1020	Open book?
1021	Close book?
For events 1, 36, 52 and 79 there seem to be only one row.

There are some inconsistencies. Both events 46 and 80 count page turns, but they don't match. The count for 80 is always less than for 46. It is possible that 46 is counting screens and 80 page numbers. The value for 46 is what is on the stats screen for the current book.

When I have looked at ExtraData, it tends to be made up of a series of timestamps. I suspect that for events like 1020 and 1021, it is a list of the times when the event occurred. The pairs from the two events might be used to calculate the minutes per session and hours read. The only problem with that, is that the counts don't match for the book I am currently reading. I am confident of the meaning of the events, but there seems to be occasions when the close is not recorded.
davidfor is offline   Reply With Quote
Old 05-11-2013, 09:15 AM   #5
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 psy65 View Post
as you say it would probably be possible to transfer those 2 type of records from one database to another but it would not be that easy. then copying the whole table content would probably be easier.
If I was doing this, I would copy all the rows for ContentID starting with "file:///mnt". That would get all the events for sideloaded books. Loading that into the new database before starting to read any of the books, should be safe and give you what you want. The rows for books that are synced via the server, should be restored when at a sync.
davidfor is offline   Reply With Quote
Old 10-19-2014, 04:34 AM   #6
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Is it safe to remove rows? I have some "5" events corresponding to books that do not exist anymore (I renamed or moved the files, or they were only for testing anyway)
Jellby is offline   Reply With Quote
Old 10-19-2014, 05:36 AM   #7
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 Jellby View Post
Is it safe to remove rows? I have some "5" events corresponding to books that do not exist anymore (I renamed or moved the files, or they were only for testing anyway)
Yes, it is safe to remove any of the rows. The firmware will insert a row if it can't find one. The only affect that removing event id 5 rows has will be reducing the number of books read.
davidfor is offline   Reply With Quote
Old 10-13-2016, 04:04 AM   #8
pindakaasmetmayo
Junior Member
pindakaasmetmayo began at the beginning.
 
Posts: 6
Karma: 10
Join Date: May 2016
Device: Kobo Glo HD
Hi! I want to change my reading stats as well. You guys seem to be in control of hoe it works. So here's the deal: my ereader stats say I read 31 books, but I only finished 22 books and I find this difference really annoying. Hoe do I change this? I really only read 22, have no kobo epubs, etc.

(I could in the past read books, close them (instead of flipping past the last page) and mark them read, and then they wouldn't count to the reading stats number (this is how I got to 31 instead of 22, long story). But this doesn't work anymore. Does anyone know how to do this? As this would solve my problem.
pindakaasmetmayo is offline   Reply With Quote
Old 10-13-2016, 06:34 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,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 pindakaasmetmayo View Post
Hi! I want to change my reading stats as well. You guys seem to be in control of hoe it works. So here's the deal: my ereader stats say I read 31 books, but I only finished 22 books and I find this difference really annoying. Hoe do I change this? I really only read 22, have no kobo epubs, etc.

(I could in the past read books, close them (instead of flipping past the last page) and mark them read, and then they wouldn't count to the reading stats number (this is how I got to 31 instead of 22, long story). But this doesn't work anymore. Does anyone know how to do this? As this would solve my problem.
What firmware are you using? Neither 3.19.5761 or 4.1.7729 behave like that for me. If I mark a book as finished it doesn't increase the finished book count. I can't remember if earlier firmware was different, but I don't think so.

The only way to fix this, is to make changes to the database one the device. You need to access it with a SQLite database manager, find the extra rows and delete them. The table to look at is "Event". The finished books have "EventType=5". The column "ContentID" for the book that was finished. Find the rows for the 9 books you don't want finished and delete them.

I would recommend taking a backup of the database before doing this. It should be safe, but it is better to be safer.
davidfor is offline   Reply With Quote
Old 10-14-2016, 02:23 AM   #10
pindakaasmetmayo
Junior Member
pindakaasmetmayo began at the beginning.
 
Posts: 6
Karma: 10
Join Date: May 2016
Device: Kobo Glo HD
Thank you for your fast reply. I found a difference: if I have opened a book (for example 10%) and I mark it finished (not by flipping past the last page, but in the library) it will count towards my reading stats number. But when I have opened a book, marked it unread and then marked it finished, it will not count towards my reading stats number of books I read. Do you have the same?

So I think I have found a non-invasive way to change the number, so hopefully I won't have to go into the database. It sounds difficult. I will remember your post for when my solution doesn't work. Thank you!
pindakaasmetmayo is offline   Reply With Quote
Old 10-14-2016, 03:06 AM   #11
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 pindakaasmetmayo View Post
Thank you for your fast reply. I found a difference: if I have opened a book (for example 10%) and I mark it finished (not by flipping past the last page, but in the library) it will count towards my reading stats number. But when I have opened a book, marked it unread and then marked it finished, it will not count towards my reading stats number of books I read.
I kind of like that. But I wonder if you need to have more than a certain percent read for it to be counted as finished. With the amount of "wonderful" extras at the end of a book, a lot are left unfinished.
Quote:
Do you have the same?
A quick test, and no it didn't work that way for me. But, I can think of something else that might be involved, so I need to do some better tests.
Quote:
So I think I have found a non-invasive way to change the number, so hopefully I won't have to go into the database. It sounds difficult. I will remember your post for when my solution doesn't work. Thank you!
If it works, good.
davidfor is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Touch How to check your reading stats while you read on epubs Reaper1242 Kobo Reader 3 01-05-2013 04:34 AM
Reading Stats - Books Finished Incorrect DragonflyKing Kobo Reader 0 12-29-2012 11:57 PM
Managing reading queue and read books paulfiera Calibre 5 05-08-2011 06:07 AM
READ 100 BOOKS in 2011! The What Are You Reading Thread. kindlekitten Reading Recommendations 12 01-06-2011 12:24 AM


All times are GMT -4. The time now is 04:29 PM.


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