twiddli / happypanda

A cross platform manga/doujinshi manager with namespace & tag support
http://pewpew.moe/project/happypanda
Other
168 stars 32 forks source link

Critical Error when importing database #189

Closed UnlimitedArk closed 6 years ago

UnlimitedArk commented 6 years ago

Not sure if this version is still getting support, but i'm encountering an issue similar to one i posted a while ago, so at least i wanted to try and ask. I'm trying to import my database on another clean instance (no db folder) so i can retain tags, favorites and other metadata, while cleaning tags that have no galleries, but when i import the database, it gets to something like 3/1732 and then a critical error appears. Here is the log and the debug log, which at the end has a

03-02 15:33 CRITICAL app File "D:\Code\Github\Happypanda\version\io_misc.py", line 802, in import_data File "D:\Code\Github\Happypanda\version\io_misc.py", line 720, in find_pair File "D:\Code\Github\Happypanda\version\gallerydb.py", line 1215, in gen_gallery_hash

03-02 15:33 CRITICAL app <class 'app_constants.InternalPagesMismatch'>:

Happy Panda log&debug log.zip

Thanks for the help regardless, happypanda x looks neat, can't wait for full release

twiddli commented 6 years ago

Hello, It might be because hashes for the gallery pages haven't been generated yet. Try forcing the generation by exporting to a .hpdb again.

UnlimitedArk commented 6 years ago

Hello, thanks for the fast response. I did what you told me and it seems to have worked, i exported a new db on the clean version, then imported the correct one and it went throught with no errors, even the latest things i added got imported.

Only problem is, is that i've learned that my habit of editing the gallery's content withouth actually reuploading the gallery (like adding a cover, a new chapter on a tank, or rearranging the pages), messes up the database a bit. For example the db remembers that "gallery ID 900 has 20 pages and is favorited", but on the clean install it gets uploaded with 21 pages, and on the log it shows that id 900 doesn't find a pair and doesn't copy the data. But it's not that big of a deal since the log indicates which IDs did not find a pair and i can look for it in the dbs manually (Can you search for ID number directly on hp? Doesn't seem to work with id:"##")

If i may ask for another thing, i'm having 2 problems with the duplicate search too, i'm not even sure how it works since i've never used it. First of all, it doesn't complete, it gets a critical error that says :

04-02 19:28 CRITICAL app File "D:\Code\Github\Happypanda\version\app.py", line 1159, in checkSimple File "D:\Code\Github\Happypanda\version\misc.py", line 1655, in add_text File "C:\Python\35\lib\threading.py", line 844, in start

04-02 19:28 CRITICAL app <class 'RuntimeError'>: can't start new thread

As for the 2nd problem, even thought it doesn't complete the dupe search, it still populates the duplicate tab, but with a lot of false positives from untitled chapters that only have the artist field different, and some galleries even appear 5-6 times next to each other with the same id. I'm not sure how i could rename all those galleries to have a unique name, and i have no idea why some of them appear multiple times ; i could search -untitled, but doing that i'd never find if maybe i have a titled&translated duplicate of that untitled gallery.

Sorry for all the questions, the help on the import was enough, but if i understood how to use the duplicate search it would be a lifesaver since i was relying on visipics to tell me if i had duplicates of translated\untranslated (but that one compares every image so it clogs everything, seeing only galleries would be much tidier). Thanks again!

twiddli commented 6 years ago

I don't remember the last time I used the duplicate checker. If I remember right then it did only compare the gallery titles and gallery artists (maybe gallery path too?), hence the name simpleChecker. I was going to add an advanced version later. For a better duplicate checker, I suggest waiting for HPX.

No, you can't search for gallery id's. Only way is to open your database in a SQLite viewer and look for the id manually in the series table.

As for the critical error. A quick look in the code and I see that I spawn a Timer thread on every notification text (occurs for every gallery in your database): https://github.com/Pewpews/happypanda/blob/324bbdba3da71c1c4cdaee37285179d32cf9269a/version/misc.py#L1655 This is obviously very poorly written and the only way around it is to remove or rewrite that piece of code. If you can live with duplicates, then I suggest just waiting for HPX, which will have more and better management tools at your disposal.

UnlimitedArk commented 6 years ago

I see, thanks for the explanation, at least i know how it works, i'm really relieved that you still provided support for this version. I've no problems with staying with the duplicate search as it is for now, after all it's not even entirely useless as sometimes it helped me found legitimate duplicates, and as for the multiple false positives with "unknown" in the title, i could just live with it and exclude them every time or add the title:unknown as tag instead of in the title. As for the error, if i so wanted i could circumvent it by splitting the collection in 2 clean instances of hp, or i can just keep using visipics, since it's not like i'm checking for dupes everyday. Thanks for all the help, the database working again is what really mattered to me, now i'll clean the unpaired galleries and i'll remember to reupload them if i ever change the contents in the future. Good work on HPX!