xxyzz / WordDumb

A calibre plugin that generates Kindle Word Wise and X-Ray files for KFX, AZW3, MOBI and EPUB eBook.
https://xxyzz.github.io/WordDumb/
GNU General Public License v3.0
377 stars 19 forks source link

X-Ray is not hideen beyond the point of reading #55

Open Phobooky opened 2 years ago

Phobooky commented 2 years ago

Describe the bug

As you can see in the screenshots (second to the end), X-Ray is hidden beyond the point of reading to protect the appareances of the character in future reading (spoilers). This not happen is your X-Ray files as you can see in the first screenshot. All of the images have been taken having the point of reading in the middle of the book more or less. By the way, with the standard way of working, if you want to go beyond the point of reading, you can do it, as you can see in the other screenshots. I enclose a correct X-Ray file.

System Information

OS: Windows 11 calibre version: Last one Phyton version: Python 3.10.5 Plugin version: 3,24.0

Error message

None

Reproduce steps

  1. Tap in a X-Ray word
  2. Go to X-Ray

Screenshots or videos

screenshot_2022_07_30T08_35_37+0100 Captura de pantalla 2022-07-30 094033 screenshot_2022_07_30T08_42_02+0100 screenshot_2022_07_30T08_42_09+0100

Sira - Maria Duenas Vinuesa.zip

xxyzz commented 2 years ago

I don't know how this feature is enabled, the sqlite file looks exactly the same. There is a show_spoilers_default column in the book_metedata table but set it to 0 doesn't have any effect.

Phobooky commented 2 years ago

This X-Ray file has been created with the X-Ray Plugin. It was deprecated but I updated it for my use. I didn't published it because yet because it was only in Spanish and then I discovered your that is better. But you can see in this plugin how it is created. I'II try to investigate a little too.

Phobooky commented 2 years ago

The only strange thing that the "x-ray plugin" does when going through the code quickly, is that it sorts the list of entities. I don't know why it does it:

def fill_entity(self, log):
    '''Writes entity table'''
    entity_data = []
    sortedList = []
    for entity in self._entity_data.keys():
        original_label = self._entity_data[entity]['original_label']
        entity_id = str(self._entity_data[entity]['entity_id'])
        entity_type = str(self._entity_data[entity]['type'])
        count = str(self._entity_data[entity]['mentions'])
        has_info_card = '1' if self._entity_data[entity]['description'] else '0'
        entity_data.append((entity_id, original_label, None, entity_type, count, has_info_card))
        sortedList.append((original_label, self._entity_data[entity]['entity_id'], self._entity_data[entity]['mentions']))

    self._db_writer.insert_into_entity(entity_data)
    log(StatusInfo.F_XRAY_DBWRITER_ENTITIES)
    sortedList = sorted(sortedList, key=lambda entity: entity[2], reverse=True)
    i = 0
    while i < len(sortedList):
        log(StatusInfo.F_XRAY_DBWRITER_ENTITIE_DETAIL.format(sortedList[i][0], 
        sortedList[i][1], sortedList[i][2]))  
        i += 1
Phobooky commented 2 years ago

Suggestion: In the X-Ray from the other source, the characters with spoiler protection appears as "PERSON". In yours the characters appear as: Source: Kindle Shop or Wikipedia, never as PERSON.

xxyzz commented 2 years ago

Maybe it requires has_excerpts to be 1. To be frank, I'm not interested in the spoiler and excerpt feature, I don't think they are very helpful for reading books.

The source can only be None, Wikipedia or Fandom, it can't be Kindle Store.

Phobooky commented 2 years ago

Don't worry. If you don't think it could be usefull, it is not a problem for me to close the issue. I only want to help you. Sorry. Perhaps you're right.