BasioMeusPuga / Lector

Qt based ebook reader
GNU General Public License v3.0
1.51k stars 207 forks source link

Exception trhown at the end of scan library #22

Closed zryogi closed 6 years ago

zryogi commented 6 years ago

I'm getting an exception thrown at the end of scan library. Here is the stacktrace:

Available parsers: *.pdf *.epub *.mobi *.azw *.azw3 *.azw4 *.prc *.cbz *.cbr
Database returned nothing
357 books found
No cover found for: /home/ryogi/drive/Books/Literature/Cassandra Clare/The Infernal Devices/Book 1 - Clockwork Angel by Cassandra Clare.epub
"Error: Non conformant codestream TPsot==TNsot.<0a>"
"Error: Non conformant codestream TPsot==TNsot.<0a>"
Corrupt JPEG data: 310222 extraneous bytes before marker 0xd9
Exception in thread Thread-10:
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "/usr/lib/python3.6/site-packages/lector/sorter.py", line 168, in read_book
    book_ref.read_book()
  File "/usr/lib/python3.6/site-packages/parsers/epub.py", line 36, in read_book
    contents_found = self.book_ref.read_epub()
  File "/usr/lib/python3.6/site-packages/ePub/read_epub.py", line 38, in read_epub
    None, True)
  File "/usr/lib/python3.6/site-packages/ePub/read_epub.py", line 79, in get_file_path
    return root_item.get('full-path')
AttributeError: 'NoneType' object has no attribute 'get'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.6/site-packages/lector/sorter.py", line 259, in pool_creator
    self.read_book, self.file_list)
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 266, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 644, in get
    raise self._value
AttributeError: 'NoneType' object has no attribute 'get'

Finished processing in 35.2248158454895

I'm not sure exactly what book caused the issue, Is there an option to increase the ammount of verbosity?

Regards.

BasioMeusPuga commented 6 years ago

Try the latest commit, you should get an error specifying the name of the book.

zryogi commented 6 years ago

Thank you, I'm now getting this:

Locale: es_CO (Translations found)
Available parsers: *.pdf *.epub *.mobi *.azw *.azw3 *.azw4 *.prc *.cbz *.cbr
Database returned nothing
357 books found
No cover found for: /home/ryogi/drive/Books/Literature/Cassandra Clare/The Infernal Devices/Book 1 - Clockwork Angel by Cassandra Clare.epub
"Error: Non conformant codestream TPsot==TNsot.<0a>"
ePub module: /home/ryogi/drive/Books/Statistics/Probability/[Jordan M. Stoyanov] Counterexamples in Probability.epub has a malformed container.xml
Cannot process: /home/ryogi/drive/Books/Statistics/Probability/[Jordan M. Stoyanov] Counterexamples in Probability.epub
"Error: Non conformant codestream TPsot==TNsot.<0a>"
Corrupt JPEG data: 310222 extraneous bytes before marker 0xd9
Finished processing in 48.769850969314575

But still no books are beign added to the library. When I try to rescan withiut the culprit book I get this:

356 books found
[David M. Buchla, Thomas L. Floyd] Electronics Fundamentals. Circuits, Devices, and Applications.pdf is already in database
poster-jpn-eng-jlpt1-landscape-color(1).pdf is already in database
How to Sound Intelligent in Japanese, A Vocabulary Builer.pdf is already in database
[Springer UTM] [Ethan D. Bloch] Proofs and Fundamentals A First Course in Abstract Mathematics.pdf is already in database
Finished processing in 0.1407170295715332

Some warnings about dome books already added, but still no books displayed in the main window of the application. With the indicator at the bottom right corner telling me: "0 books"

BasioMeusPuga commented 6 years ago

Try the following, just so I know for sure:

  1. Delete ~/.local/share/Lector/Lector.db
  2. Open the application and add a book using the + button in the toolbar. Try it with another book if you get errors like the ones above.
  3. If there's still nothing, make sure the dependencies I mentioned in the README are at their suggested versions.

Tell me if files start to show at any point. Stuff is clearly getting added to the database. The model that is built off the metadata is failing. Let's take this stepwise.

zryogi commented 6 years ago

Following your instructions, this is what I got after removing Loector.db :

Locale: es_CO (Translations found)
Database returned no paths for settings...
Available parsers: *.pdf *.epub *.mobi *.azw *.azw3 *.azw4 *.prc *.cbz *.cbr
Database returned nothing
kf5.kio.core: KSambaShare: Could not find smb.conf!
Finished processing in 0.1383671760559082
Finished processing in 0.13362717628479004
Finished processing in 0.13757109642028809
Finished processing in 0.3362269401550293
Finished processing in 0.33777475357055664

Each Finished... line is after adding just one book. Still no content added to the main window of the application.

Additional information:

Using Qt version 5.10.1 in /usr/lib
Python 3.6.4
python-pyqt5 5.10.1-1
python-requests 2.18.4-1
python-beautifulsoup4 4.6.0-1
poppler-qt5 0.61.1-1
python-poppler-qt5 0.24.2-2
$ uname -a
Linux ryogi-pc 4.15.9-1-ARCH #1 SMP PREEMPT Sun Mar 11 17:54:33 UTC 2018 x86_64 GNU/Linux

If you need any more information, let me know.

BasioMeusPuga commented 6 years ago

I just fixed a similar bug. See if the latest commit helps at your end.

zryogi commented 6 years ago

After updating to the latest version this problem seems to be solved.

Thanks.