Thread: Tag troubles
View Single Post
Old 06-22-2010, 09:00 AM   #24
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,486
Karma: 8025704
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
I performed two experiments with my PRS-300 on Win7 with standard firmware. The first experiment was sending a text file to the device, unplugging it, replugging, and sending it again. The second was resetting the mtime of the text file to what it was before sending it the second time.

The first experiment shows that after the first sending of the text file, the author and title on my Sony are what I set in calibre (correct) and the ctime and mtime are identical (correct). After sending it again:
  • the ctime does not change (correct),
  • the mtime does change (correct),
  • the author and title don't change (correct)
After changing the ctime and mtime (the second experiment):
  • the Sony reset the time in its database to the new mtime (correct)
  • the author became blank (correct)
  • the title became the file name (correct)
In all cases the time to disconnect was 15 seconds +/- 1 second.

The experiments show that my Sony is using mtime instead of ctime, and that if the mtime in the database does not match the mtime of the book file, Sony rebuilds the metadata in its database by scanning the books. Because the book in the experiment is a text file, the only metadata the Sony SW can find is the file name. Conclusion: my 300 is behaving as expected and desired.

Your connecting the device to two different machines does raise a possibility. Calibre's preferred matching method for for the on-device function is the book's UUID (unique ID). This ID is assigned by calibre when the book is imported, assuming that the book doesn't already have one.

If a book on the device has a UUID different from the book in the library, title and author matching is used. If these match, then the metadata from that library is sent back to the device to correct the UUID. As a side effect, the calibre device driver scans the Sony db to ensure that the titles and authors agree with the new metadata. During this process, the mtime on the device is fetched and written to the Sony db using the format %w, %d %m %Y %H:%M:%S GMT (dayname, daynumber monthname yearnumber hour:minute:second GMT).

If the two machines use a different method for obtaining the date, this process can result in confusion. If one machine uses ctime and one mtime (it is hard to believe this could happen, but it is possible), then when the device is plugged into the one using ctime, the Sony will rescan the library when the device is disconnected. It should not rescan again on that machine until a book is added or changed, or a collection changed (anything that sends metadata).

When the device is connected to the other machine, the UUIDs could change, causing the process to start over again. The Sony database will be checked and modified as needed. Because the assumption is that this second machine uses mtime, the sony should not rescan on this machine. However, because the UUIDs changed, the device will rescan when connected & disconnected from the first.

If the custom firmware uses ctime, then the Sony will rescan every time you change machines, or add/change a book or collection. If the custom firmware has a date string format different from the Sony standard firmware, then the device will rescan under the same conditions.
chaley is offline   Reply With Quote