- audiobooks[$root.attr("data-book-id")] = [Date.now(), $root.attr("data-media-id"), event.jPlayer.status.currentTime];
+ t = event.jPlayer.status.currentTime;
+ if (t && event.jPlayer.status.duration - t > 10) {
+ audiobooks[$root.attr("data-book-slug")] = [
+ Date.now(),
+ event.jPlayer.status.media.id,
+ event.jPlayer.status.currentTime
+ ];
+ } else {
+ delete audiobooks[$root.attr("data-book-slug")];
+ }
+ // Remove old book id, if present.
+ delete audiobooks[$root.attr("data-book-id")];