Welcome, Guest
Python Scripts for ComicRack

TOPIC: Duplicates Manager (v Alpha - 0.6)

Duplicates Manager (v Alpha - 0.6) 4 months 3 days ago #49253

  • krandor
  • krandor's Avatar
  • Offline
  • Gold Boarder
  • Posts: 307
  • Thank you received: 32
  • Karma: 5
This is a script I personally use a lot mainly because I'd rather download the same comic 2-3 times then miss one and if you do that you have to filter out the dupes in some way.

The script works well especially with my mod which was then expanded on to look at CVDB value for dupes.

The only issue is there are certain characters or strings that cause it to throw an exception which is annoying. I'd almost rather it just continue and ignore the exception then balk like it does because my process when they happens is to grab half the comics, run DM and then if that fails, run it on the other half and rinse repeat until I find the bad comic. It works but is time consuming.

So if I get to the point where I know if I run DM on these two dupes and that is what throws the exception, I normally just manually delete one and I'm good. What can I do to gather information to help determine why it is throwing an exception so we can find a fix? I appreciate any help anybody can give and I'll do what I can to capture that data. In fact I'm currently in the middle of doing the half by half process right now.
The administrator has disabled public write access.

Duplicates Manager (v Alpha - 0.6) 4 months 3 days ago #49254

  • krandor
  • krandor's Avatar
  • Offline
  • Gold Boarder
  • Posts: 307
  • Thank you received: 32
  • Karma: 5
This current issue was an issue number "1/2". Script wouldn't handle that and that makes sense that a non-number if the number field could cause the script an issue..
The administrator has disabled public write access.

Duplicates Manager (v Alpha - 0.6) 4 months 3 days ago #49262

  • boshuda
  • boshuda's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 334
  • Thank you received: 85
  • Karma: 10
krandor wrote:
This current issue was an issue number "1/2". Script wouldn't handle that and that makes sense that a non-number if the number field could cause the script an issue..

It's probably the character encoding. Python 2.7 defaults to ANSI, but various tools work in utf8, including ComicRack itself. So when you try to use the characters outside of that ANSI range (like ½) Python 2.7 doesn't know what to do with it, so you get the exception.

From duplicatesmanager.py, add the sys.setdefaultencoding("utf8") line, or use the attached file.

File Attachment:

File Name: duplicatesmanager.zip
File Size:5 KB


#########
#
#    Import section

import sys, traceback
import re
import clr
import System
import System.IO
from System.IO import Path, Directory, File, FileInfo

sys.setdefaultencoding("utf8")

clr.AddReference("System.Windows.Forms")
from System.Windows.Forms import DialogResult, MessageBox, MessageBoxButtons, MessageBoxIcon
The administrator has disabled public write access.
The following user(s) said Thank You: perezmu

Duplicates Manager (v Alpha - 0.6) 3 months 4 weeks ago #49291

  • krandor
  • krandor's Avatar
  • Offline
  • Gold Boarder
  • Posts: 307
  • Thank you received: 32
  • Karma: 5
Thanks. I,l try that. I think character encoding is the biggest issues I'm seeing. No issues this week even without your patch while I plan to apply this weekend.
The administrator has disabled public write access.
Time to create page: 0.207 seconds

Who's Online

We have 181 guests and 2 members online