Welcome, Guest
Python Scripts for ComicRack

TOPIC: ComicVineScraper - an ImportComicVineInfo clone

Re:ComicVineScraper - an ImportComicVineInfo clone 7 years 8 months ago #5339

  • cYo
  • cYo's Avatar
  • Offline
  • Moderator
  • Posts: 3476
  • Thank you received: 675
  • Karma: 181
I looked into the script and it does some very BAD things. You can remove all the Monitor.Enter/Exits. They make no sense on the form and they might kill on ComicBook (ComicBook class is inherently written threadsafe).

The script runs in a secondary thread and that it should not do if it accesses MainForm. The Windows GUI subsystem is not thread safe (because of performance reasons and/or it being designed in the 80's). The whole second thread thing makes the script unstable.

So remove all monitor.enter/exit.
remove the creation of the seondary thread.
The administrator has disabled public write access.

Re:ComicVineScraper - an ImportComicVineInfo clone 7 years 8 months ago #5341

  • cYo
  • cYo's Avatar
  • Offline
  • Moderator
  • Posts: 3476
  • Thank you received: 675
  • Karma: 181
I've made a patched version of ComicVineScript.py that removes all the unnecessary stuff.

EDIT: I've now made the full patch. Replace your current ComicVineScaper.py with this one. Everything should now again work as expected.

File Attachment:

File Name: ComicVineS...tch2.zip
File Size:16 KB
Attachments:
Last Edit: 7 years 8 months ago by cYo.
The administrator has disabled public write access.

Re:ComicVineScraper - an ImportComicVineInfo clone 7 years 8 months ago #5343

  • RevQuixo
  • RevQuixo's Avatar
  • Offline
  • Gold Boarder
  • Posts: 279
  • Thank you received: 25
  • Karma: 12
cYo,

Whatever you did in there has solved my issue with the script hanging (#3 on cbanack's google software issues log). Thanks for giving the script a good once over :)

To anyone looking to install cYo's edits..this is *not* a complete version of the comicvine scraper so do not use the script installer function to install it. Instead just unzip the file into the AppData\Roaming\cYo\ComicRack\Scripts\Comic Vine Scraper folder.

Thanks again,

Rev
The administrator has disabled public write access.

Re:ComicVineScraper - an ImportComicVineInfo clone 7 years 8 months ago #5344

  • cYo
  • cYo's Avatar
  • Offline
  • Moderator
  • Posts: 3476
  • Thank you received: 675
  • Karma: 181
EDIT:

I updated my patch now with all the changes mentioned below. Solution for the thread abort problem is a hack, but works.

But if there are still problems, replace it with the old one. I'm not taking this script over, I just have a sleepless night :)

cbanack should patch his script with my changes. I'm not going to take this script over :)

ORIGINAL POST:

My changes are just to give a hint on what to do.

e.g. you can not press "Cancel" anywhere now with my changes in place, as the script calls Thread.Abort on various places in this case and this now kills ComicRack itself :)

But to edit these all out and make proper returns of the methods instead goes beyond the scope of my meddling with it :)

just another hint: you should remove all thread related imports and methods from the script.
Last Edit: 7 years 8 months ago by cYo.
The administrator has disabled public write access.

Re:ComicVineScraper - an ImportComicVineInfo clone 7 years 8 months ago #5349

  • cbanack
  • cbanack's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1318
  • Thank you received: 503
  • Karma: 181
Hey, thanks for the help, cYo. :cheer:

I'm glad that the problem did turn out to be related to threading and monitors...I'd already been working on a version of the script that has the monitor stuff removed...but I hadn't thought to go so far as to remove threading from the script altogether. :P

Anyway, I will put your changes into version 1.0.4 as soon as I can, and release it for everyone.
The administrator has disabled public write access.

Re:ComicVineScraper - an ImportComicVineInfo clone 7 years 8 months ago #5352

  • cbanack
  • cbanack's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1318
  • Thank you received: 503
  • Karma: 181
cYo wrote:
The script runs in a secondary thread and that it should not do if it accesses MainForm. The Windows GUI subsystem is not thread safe (because of performance reasons and/or it being designed in the 80's). The whole second thread thing makes the script unstable.

Ah, I understand completely. Swing (the Java GUI toolkit) has exactly the same single-threading restriction. I always have to yell at developers at work for violating that rule.

And the Thread.abort() stuff? Well, it was already on my list of things to refactor away, but I think I'll bump it up to a higher priority now.
The administrator has disabled public write access.

Re:ComicVineScraper - an ImportComicVineInfo clone 7 years 8 months ago #5355

  • cbanack
  • cbanack's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1318
  • Thank you received: 503
  • Karma: 181
Ok, I've implemented the changes that cYo suggested (basically removed all threading from the script), plus I reworked the cancel buttons so that they don't crash ComicRack in the new single-threaded environment. (Issue 5 is still outstanding, though.)

The changes are available in release 1.0.4, which should fix issues 1 and 3.

Please bear with me if I've accidentally introduced new bugs with 1.0.4. This was a tricky change to some (still largely) unfamiliar code. In a programming language that I'm still learning. :dry: Report any issues that you find, and I'll fix 'em a fast as I can.

@bkagan: are things working any better for you in 1.0.4?
@RevQuixo: how about you? Can I close issue 3? B)
@cYo: thanks again for your help! :lol:
The administrator has disabled public write access.

Re:ComicVineScraper - an ImportComicVineInfo clone 7 years 8 months ago #5356

  • perezmu
  • perezmu's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1112
  • Thank you received: 64
  • Karma: 51
:blush: :blush: :blush: :blush: :blush: :blush: :blush: :blush: :blush:

Thanks guys for fixing this!!!!
Last Edit: 7 years 8 months ago by perezmu.
The administrator has disabled public write access.

Re:ComicVineScraper - an ImportComicVineInfo clone 7 years 8 months ago #5359

  • RevQuixo
  • RevQuixo's Avatar
  • Offline
  • Gold Boarder
  • Posts: 279
  • Thank you received: 25
  • Karma: 12
cbanack wrote:
@RevQuixo: how about you? Can I close issue 3?

I put the 1.0.4 script through its paces and this bug is officially squashed. :)
The administrator has disabled public write access.

Re:ComicVineScraper - an ImportComicVineInfo clone 7 years 8 months ago #5360

  • bkagan
  • bkagan's Avatar
  • Offline
  • Senior Boarder
  • Posts: 72
  • Karma: 2
Yep things seem to be working MUCH better.
Thank you.

I have a number TPBs that don't seem to be found. The comic series comes up but not the Trade. I realize this is a comicvine issue and not the scraper.

I guess I need to make an account with comicvine and start adding.

One Question though;
is there a way to remove comic meta data or RE-scrape it, if the original is incorrect ?[user error :( ]
The administrator has disabled public write access.
Time to create page: 0.226 seconds

Who's Online

We have 229 guests and one member online