View Single Post
Old 07-24-2018, 03:17 PM   #523
Sam Sahara
Connoisseur
Sam Sahara doesn't litterSam Sahara doesn't litterSam Sahara doesn't litter
 
Posts: 79
Karma: 228
Join Date: Aug 2014
Device: lambda k21
Maybe a bug

I use the annotations plugin to fetch annotations from a kobo A1.

There are two types of annotations:
  • simple highlights: the text is underlined;
  • highlights with annotations: the text is underlined and the user adds some personal chunk of text.

Well, the bug is: every time I fetch the annotations from the kobo to calibre, the simple highlights that are already fetched are not fetched again, while the highlights with annotations are newly added to notes.

As a clarification I add the code taken from the opf file of a my epub with some notes and highlights: as you can see every highlight with notes are repeated two times, whlie the simple highlights are not.

Code:
<meta
  name="calibre:user_metadata:#mm_annotations"
  content="{'label': 'mm_annotations','link_column': 'value','display': {},'is_editable': true,'is_custom': true,'table': 'custom_column_19','is_csp': false,'category_sort': 'value','name': 'Annotations','datatype': 'comments','#extra#': null,'rec_index': 27,'colnum': 19,
  '#value#':
    '<div class=\'user_annotations\' style=\'margin:0\'>
    <div class=\'annotation\' genre=\'\' hash=\'0b59471c538494c262593330dae33efc\' location_sort=\'011016\' reader=\'KoboTouch\' style=\'margin:0 0 0.5em 0\'>
    <table cellpadding=\'0\' width=\'100%\' style=\'background-color:LightGray;color:black;font-size:80%;font-weight:bold;margin:0;\' color=\'Gray\'>
      <tr>
        <td class=\'location\' style=\'text-align:left\'>II</td>
        <td class=\'timestamp\' uts=\'1528105650.0\' style=\'text-align:right\'>lun 04 giu 2018 11:47:30 </td>
      </tr>
    </table>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'>Vi assicuro con la massima serietà che molte volte ho desiderato di diventare un insetto.</p>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'></p>
    <p class=\'note\' style=\'background-color: rgb(255, 255, 77);font-size:90%;font-style:italic;margin:0;\'>Forse Gregor S.?</p>
    <p class=\'note\' style=\'background-color: rgb(255, 255, 77);font-size:90%;font-style:italic;margin:0;\'></p>
    </div>

    <!-- This div group repeats the preceding one -->
    <div class=\'annotation\' genre=\'\' hash=\'27f6e510b7334401b8bd86d7d377e932\' location_sort=\'011016\' reader=\'KoboTouch\' style=\'margin:0 0 0.5em 0\'>
    <table cellpadding=\'0\' width=\'100%\' style=\'background-color:LightGray;color:black;font-size:80%;font-weight:bold;margin:0;\' color=\'Gray\'>
      <tr>
        <td class=\'location\' style=\'text-align:left\'>II</td>
        <td class=\'timestamp\' uts=\'1528105650.0\' style=\'text-align:right\'>lun 04 giu 2018 11:47:30 </td>
      </tr>
    </table>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'>Vi assicuro con la massima serietà che molte volte ho desiderato di diventare un insetto.</p>
    <p class=\'note\' style=\'background-color: rgb(255, 255, 77);font-size:90%;font-style:italic;margin:0;\'>Forse Gregor S.?</p>
    </div>

    <div class=\'annotation\' genre=\'\' hash=\'39ec145f4967efbd85099567b490d72e\' location_sort=\'012085\' reader=\'KoboTouch\' style=\'margin:0 0 0.5em 0\'>
    <table cellpadding=\'0\' width=\'100%\' style=\'background-color:LightGray;color:black;font-size:80%;font-weight:bold;margin:0;\' color=\'Gray\'>
      <tr>
        <td class=\'location\' style=\'text-align:left\'>III</td>
        <td class=\'timestamp\' uts=\'1528182681.0\' style=\'text-align:right\'>mar 05 giu 2018 09:11:21 </td>
      </tr>
    </table>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'>Signore Iddio, ma a me che importa delle leggi della natura e dell’aritmetica se poi, chissà perché, queste leggi e questo due più due quattro non mi piacciono? S’intende che non cercherò di abbattere quel muro a testate se non avrò davvero la forza di abbatterlo, ma non mi concilierò con esso soltanto perché mi trovo davanti un muro di pietra e le mie forze non sono sufficienti.</p>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'></p>
    </div>

    <div class=\'annotation\' genre=\'\' hash=\'d41d8cd98f00b204e9800998ecf8427e\' location_sort=\'012100\' reader=\'KoboTouch\' style=\'margin:0 0 0.5em 0\'>
    <table cellpadding=\'0\' width=\'100%\' style=\'background-color:LightGray;color:black;font-size:80%;font-weight:bold;margin:0;\' color=\'Gray\'>
      <tr>
        <td class=\'location\' style=\'text-align:left\'>III</td>
        <td class=\'timestamp\' uts=\'1528182829.0\' style=\'text-align:right\'>mar 05 giu 2018 09:13:49 </td>
      </tr>
    </table>
    </div>

    <div class=\'annotation\' genre=\'\' hash=\'07d445f8e87b324e7e19f0f0d044ccee\' location_sort=\'017040\' reader=\'KoboTouch\' style=\'margin:0 0 0.5em 0\'>
    <table cellpadding=\'0\' width=\'100%\' style=\'background-color:LightGray;color:black;font-size:80%;font-weight:bold;margin:0;\' color=\'Gray\'>
      <tr>
        <td class=\'location\' style=\'text-align:left\'>VIII</td>
        <td class=\'timestamp\' uts=\'1528390811.0\' style=\'text-align:right\'>gio 07 giu 2018 19:00:11 </td>
      </tr>
    </table>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'>alle spalle ben quarant’anni di sottosuolo</p>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'></p>
    <p class=\'note\' style=\'background-color: rgb(255, 255, 77);font-size:90%;font-style:italic;margin:0;\'>Forse le «Statue d'acqua» della Jaeggy provengono da questo sottosuolo.</p>
    <p class=\'note\' style=\'background-color: rgb(255, 255, 77);font-size:90%;font-style:italic;margin:0;\'></p>
    </div>

    <!-- This div group repeats the preceding one -->
    <div class=\'annotation\' genre=\'\' hash=\'15ca4833fc0dfd428f700c3317e07eab\' location_sort=\'017040\' reader=\'KoboTouch\' style=\'margin:0 0 0.5em 0\'>
    <table cellpadding=\'0\' width=\'100%\' style=\'background-color:LightGray;color:black;font-size:80%;font-weight:bold;margin:0;\' color=\'Gray\'>
      <tr>
        <td class=\'location\' style=\'text-align:left\'>VIII</td>
        <td class=\'timestamp\' uts=\'1528390811.0\' style=\'text-align:right\'>gio 07 giu 2018 19:00:11 </td>
      </tr>
    </table>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'>alle spalle ben quarant’anni di sottosuolo</p>
    <p class=\'note\' style=\'background-color: rgb(255, 255, 77);font-size:90%;font-style:italic;margin:0;\'>Forse le «Statue d'acqua» della Jaeggy provengono da questo sottosuolo.</p>
    </div>

    <div class=\'annotation\' genre=\'\' hash=\'71b6772f37d63934682e5fedd6d599a0\' location_sort=\'019100\' reader=\'KoboTouch\' style=\'margin:0 0 0.5em 0\'>
    <table cellpadding=\'0\' width=\'100%\' style=\'background-color:LightGray;color:black;font-size:80%;font-weight:bold;margin:0;\' color=\'Gray\'>
      <tr>
        <td class=\'location\' style=\'text-align:left\'>X</td>
        <td class=\'timestamp\' uts=\'1528563367.0\' style=\'text-align:right\'>sab 09 giu 2018 18:56:07 </td>
      </tr>
    </table>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'>E del resto, sapete che vi dico? Io sono convinto che noialtri, uomini del sottosuolo, dobbiamo essere tenuti al guinzaglio. Siamo capaci di starcene magari per quarant’anni rinchiusi in silenzio nel sottosuolo, ma se una volta riusciamo a liberarci e a tornare alla luce, allora cominciamo a parlare, parlare, parlare…</p>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'></p>
    </div>

    <div class=\'annotation\' genre=\'\' hash=\'ebad3644be6b2e64423ace68c8c564df\' location_sort=\'020057\' reader=\'KoboTouch\' style=\'margin:0 0 0.5em 0\'>
    <table cellpadding=\'0\' width=\'100%\' style=\'background-color:LightGray;color:black;font-size:80%;font-weight:bold;margin:0;\' color=\'Gray\'>
      <tr>
        <td class=\'location\' style=\'text-align:left\'>XI</td>
        <td class=\'timestamp\' uts=\'1528713308.0\' style=\'text-align:right\'>lun 11 giu 2018 12:35:08 </td>
      </tr>
    </table>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'>voglio fare appunto questo esperimento: è possibile essere completamente franchi con se stessi e non aver paura di tutta la verità?</p>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'></p>
    </div>

    <div class=\'annotation\' genre=\'\' hash=\'34d32afcb950e3814671537952acb828\' location_sort=\'022009\' reader=\'KoboTouch\' style=\'margin:0 0 0.5em 0\'>
    <table cellpadding=\'0\' width=\'100%\' style=\'background-color:LightGray;color:black;font-size:80%;font-weight:bold;margin:0;\' color=\'Gray\'>
      <tr>
        <td class=\'location\' style=\'text-align:left\'>I</td>
        <td class=\'timestamp\' uts=\'1528714786.0\' style=\'text-align:right\'>lun 11 giu 2018 12:59:46 </td>
      </tr>
    </table>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'>Io, per esempio, odiavo la mia faccia, la trovavo ripugnante e sospettavo perfino che vi si leggesse una espressione di viltà, e pertanto ogni volta che mi recavo in ufficio mi sforzavo tormentosamente di comportarmi nella maniera più indipendente, affinché non mi si sospettasse di viltà, e di avere il viso atteggiato all’espressione più nobile. </p>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'></p>
    </div>

    <div class=\'annotation\' genre=\'\' hash=\'c26794f3d534bf9dfbc5f73af54a8f8a\' location_sort=\'022040\' reader=\'KoboTouch\' style=\'margin:0 0 0.5em 0\'>
    <table cellpadding=\'0\' width=\'100%\' style=\'background-color:LightGray;color:black;font-size:80%;font-weight:bold;margin:0;\' color=\'Gray\'>
      <tr>
        <td class=\'location\' style=\'text-align:left\'>I</td>
        <td class=\'timestamp\' uts=\'1528723160.0\' style=\'text-align:right\'>lun 11 giu 2018 15:19:20 </td>
      </tr>
    </table>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'>A casa mi dedicavo soprattutto alla lettura. Volevo soffocare con sensazioni esteriori tutto ciò che ribolliva continuamente dentro di me. E le sole sensazioni esteriori che potessi procurarmi provenivano dalla lettura. Naturalmente la lettura mi era di notevole aiuto: mi commuoveva, mi deliziava, mi torturava. Ma certe volte anche mi annoiava terribilmente. Allora mi prendeva la voglia di muovermi, e di tanto in tanto mi sprofondavo in una dissolutezza meschina, tetra, schifosa, sotterranea.</p>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'></p>
    </div>

    <div class=\'annotation\' genre=\'\' hash=\'fe90e63880f891a42ffe13f84f2830ff\' location_sort=\'023025\' reader=\'KoboTouch\' style=\'margin:0 0 0.5em 0\'>
    <table cellpadding=\'0\' width=\'100%\' style=\'background-color:LightGray;color:black;font-size:80%;font-weight:bold;margin:0;\' color=\'Gray\'>
      <tr>
        <td class=\'location\' style=\'text-align:left\'>II</td>
        <td class=\'timestamp\' uts=\'1528753026.0\' style=\'text-align:right\'>lun 11 giu 2018 23:37:06 </td>
      </tr>
    </table>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'> È proprio così: a quel tempo io credevo ciecamente che per qualche miracolo, grazie a qualche circostanza esteriore, qualcosa si sarebbe messo in movimento, l’orizzonte si sarebbe ampliato; d’un tratto mi si sarebbe aperto un campo di attività corrispondente alle mie aspirazioni, attività benefica, stupenda e soprattutto già pronta (di quale attività esattamente si trattasse non avrei mai saputo dirlo, ma l’essenziale era il fatto che fosse già pronta), ed ecco che avrei improvvisamente fatto la mia comparsa nel mondo, addirittura su un cavallo bianco e con una corona d’alloro in capo.</p>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'></p>
    </div>

    <div class=\'annotation\' genre=\'\' hash=\'1697e6f8645d9f7f57826a39786bbd0f\' location_sort=\'024017\' reader=\'KoboTouch\' style=\'margin:0 0 0.5em 0\'>
    <table cellpadding=\'0\' width=\'100%\' style=\'background-color:LightGray;color:black;font-size:80%;font-weight:bold;margin:0;\' color=\'Gray\'>
      <tr>
        <td class=\'location\' style=\'text-align:left\'>III</td>
        <td class=\'timestamp\' uts=\'1528830842.0\' style=\'text-align:right\'>mar 12 giu 2018 21:14:02 </td>
      </tr>
    </table>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'>odiavo il suo volto bello ma sciocco (con il quale, tuttavia, avrei volentieri cambiato il mio viso intelligente) </p>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'></p>
    </div>

    <div class=\'annotation\' genre=\'\' hash=\'f76e587f075a7fb031228c01d985cb42\' location_sort=\'027052\' reader=\'KoboTouch\' style=\'margin:0 0 0.5em 0\'>
    <table cellpadding=\'0\' width=\'100%\' style=\'background-color:LightGray;color:black;font-size:80%;font-weight:bold;margin:0;\' color=\'Gray\'>
      <tr>
        <td class=\'location\' style=\'text-align:left\'>VI</td>
        <td class=\'timestamp\' uts=\'1529526147.0\' style=\'text-align:right\'>mer 20 giu 2018 22:22:27 </td>
      </tr>
    </table>
    <p class=\'highlight\' style=\'margin:0;text-indent:0.5em;\'>, sì, una schiava! Tu dai tutto, sacrifichi tutta la tua libertà. E più tardi, anche se vorrai spezzare questa catena, non sarà più possibile: ti c’invischierai sempre più strettamente. È una catena maledetta. Io la conosco bene. Lasciamo stare il resto, perché tanto tu non lo capiresti, credo; ma dimmi solo questo: ti sei già indebitata con la padrona, vero? Ecco, lo vedi!” ripresi a dire, sebbene lei non mi avesse risposto; però mi ascoltava in silenzio, mi ascoltava con tutto il suo essere; “ecco la catena che ti stringe!</p>
    </div>

    </div>',
    'kind': 'field', 'column': 'value', 'is_category': false, 'search_terms': ['#mm_annotations'], 'is_multiple2': {}, 'is_multiple': null}"/>
I've added some html comments to mark the repeated chunks.

Last edited by Sam Sahara; 07-24-2018 at 03:33 PM.
Sam Sahara is offline   Reply With Quote