solean / ibooks-highlights

Extract iBooks highlights
https://www.npmjs.com/package/ibooks-highlights
MIT License
10 stars 1 forks source link

Bug: Deleted highlights are not showing deleted #8

Closed Yadav106 closed 2 weeks ago

Yadav106 commented 1 month ago
Screenshot 2024-09-22 at 10 59 19 AM
{
    representativeText: 'Viewing as he did for intuitive feel—for trend and generality—every step in the course of human/robot interaction seemed to depend on dependence. ',
    selectedText: 'generality',
    createdOn: '2024-09-22 05:25:23',
    updatedOn: '2024-09-22 05:26:34',
    note: null,
    chapter: null,
    bookId: 'book-id-hidden',
    deleted: false,
    book: {
      title: 'The Robots of Dawn',
      author: 'Isaac Asimov',
      filePath: 'location-hidden'
    }
}

The highlight on 'generality' was first added then removed, but the code still shows the value of deleted as false

Yadav106 commented 1 month ago

The solution: in the constants.js file, the query for getting data from the sqlite database is not updated

const ANNOTATIONS_QUERY = 'SELECT zannotationassetid, zannotationrepresentativetext, zannotationselectedtext, datetime(zannotationcreationdate + strftime("%s", "2001-01-01"), "unixepoch") as CREATED_ON, datetime(zannotationmodificationdate + strftime("%s", "2001-01-01"), "unixepoch") as UPDATED_ON, zannotationnote, zfutureproofing5,zannotationdeleted FROM zaeannotation ORDER BY created_on DESC';

this query includes zannotationdeleted column which fixes the bug can i create a pr for this?

solean commented 2 weeks ago

Sorry for not getting back to you until now, I've been away on vacation. Feel free to create a pr for this. Thanks Sahil!

Yadav106 commented 2 weeks ago

Thanks! Will do!

Yadav106 commented 2 weeks ago

I've opened a PR!

solean commented 2 weeks ago

Merged the pr. Thanks for catching this and fixing it!