BasioMeusPuga / Lector

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

Lector doesn't show books after adding books on Windows #59

Closed yinkaisheng closed 6 years ago

yinkaisheng commented 6 years ago

Hi I added two books. Lector showed the progress of adding books at the bottom of UI. But Lector didn't show the books after the progress reached 100% and disappeared. I opened Lector.db. The books existed in the db. My OS is Windows 7 sp1 x64. The same issue occured on Ubuntu 16.04 too with an exception. default

` root@ubuntu:/mnt/hgfs/Python/LectorReader/lector# python3.6 main.py python-poppler-qt5 is not installed. Pdf files will not work. QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root' Locale: en_US (No translations found) Available parsers: .epub .mobi .azw .azw3 .azw4 .prc .cbz .cbr Database returned nothing Exception in thread Thread-1: 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 "/mnt/hgfs/Python/LectorReader/lector/sorter.py", line 185, in read_book book_ref.read_book() File "/mnt/hgfs/Python/LectorReader/lector/parsers/epub.py", line 36, in read_book contents_found = self.book_ref.read_epub() File "/mnt/hgfs/Python/LectorReader/lector/ePub/read_epub.py", line 38, in read_epub None, True) File "/mnt/hgfs/Python/LectorReader/lector/ePub/read_epub.py", line 75, in get_file_path xml = self.parse_xml(container_location, 'xml') File "/mnt/hgfs/Python/LectorReader/lector/ePub/read_epub.py", line 64, in parse_xml root = BeautifulSoup(this_xml, parser) File "/usr/local/lib/python3.6/dist-packages/bs4/init.py", line 165, in init % ",".join(features)) bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library? """

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 "/mnt/hgfs/Python/LectorReader/lector/sorter.py", line 277, 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 bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?

Finished processing in 0.08451461791992188 `

BasioMeusPuga commented 6 years ago

I would start by installing the lxml parser. pip install lxml or better still, use your package manager.

yinkaisheng commented 6 years ago

Hi After installing lxml. It works on Ubuntu. But it didn't work on Windows. The python console didn't show any error or exception and no books showed in the list after adding a book.

BasioMeusPuga commented 6 years ago

And you're sure you've installed pyqt5, lxml, beautifulsoup4 using pip? Because I can't reproduce it here. I was thinking it could be a filtering issue, but since you have it working in Ubuntu, that shouldn't be what's wrong. I would recommend nuking the installation - with the config files, and starting over. If that doesn't help, please send me the files, and I'll see if the program isn't reading them properly.

yinkaisheng commented 6 years ago

Maybe wrong translation caused the issue. My Ubuntu is English version and Windows is Chinese version. ` manually added

手动添加

` ` Manually Added 手动添加的 ` ![default](https://user-images.githubusercontent.com/5846696/40635722-ff9559a0-632d-11e8-8b60-835677546f50.png) **filterAcceptsRow never returns True in Chinese version.** I disabled translation then books were showed.
yinkaisheng commented 6 years ago

Please update Lector_zh.ts and Lector_zh.qm <location filename="../../library.py" line="292"/> <source>manually added</source> <translation>手动添加的</translation>

Thanks.