Welcome, Guest
Python Scripts for ComicRack

TOPIC: New Script: Get Story Arc From Titles

New Script: Get Story Arc From Titles 4 years 10 months ago #28612

  • Freakeao
  • Freakeao's Avatar
  • Offline
  • Gold Boarder
  • Posts: 199
  • Thank you received: 25
  • Karma: 6
Any number of books with similar titles and this script will find the longest common substring and give you the option of setting that as the value for the Story Arc on the selected books.

Inspiration for this script was from this thread, and specifically this post:

comicrack.cyolito.com/forum/7-general/20...it=10&start=10#20312

Let me know if there are any goofy outcomes or errors.

Download:

File Attachment:

File Name: StoryArcFr...crplugin
File Size:7 KB




Here's some instructions on how to use the different methods and what they do.

  • Always start off by using the default multiple story arc detection. This will look for "part" in the title and remove it and everything after it and then compare all titles for common substring and group issues together based on those.
  • If that doesn't work quite right for some issues select those and try the alternate method this time. It will remove "part" from title but leave everything after it. Usefull in the cases of:
  • Big Arc part 4
  • Part 5 of Big Arc

  • If those still don't get it right, use the single story arc method. This method does the strictest substring matching. It does not remove "part" before doing the match. But it does afterwards in a cleanup routine that I made.

  • I started dropping everything after the "part" by default in the multiple matching in part because of roman numerials.

    0.8.0: Adds the feature that removes a detected story arc if also found in the Alternate Series. You must check overwrite for this to happen since it will overwrite the Alternate Series. I added this to better handle multiple alternate series listed in CV, where one is really the alternate series and one is a story arc. See below for screen shots.

    V0.7.2: BETA A couple bug fixes and it now converts word numbers (two, four) to integers (2,4). Will only overwrite if the checkbox is checked for story arc overwrite.

    V0.7: BETA I made a quick pass at setting the Alternate Number based on if the Story Arc detected matches the Alternate Series provided by ComicVine. I've only tested this on a couple issues of the Trinity War in DC. I don't know how it will handle story arcs and alternate series both in the Title. That's why it's BETA and something I could use suggestions to test on.

    V0.6.1: Previously added feature in 0.6 "single book" processing now happens when handling multiple books. If a book doesn't match story arcs with any other book in the selection, it's title is processed by itself. You should now be able to process all newly added books in one run of the script.

    V0.6: Simple processing on single books. Select one book and if the title has "part" or "chapter" in it, that and everything after is removed and detected as the story arc.

    V0.5.1: Initial dialog is always centered on parent window. "Chapter" is also processed like "Part" has been.

    V0.5: Single button with new dialog to select method of story arc matching.

    V0.4.1: Remove : from Story Arc if it is the last character.

    V0.4: Title matches are now case-insensitive. Improved handling of - and (

    V0.3.1: Made the single story arc scan only require a minimum string length of 2. So if the multiple scan can't figure them all out, the single scan should pick it up.

    V0.3: I've included another script (same icon). The new one supports multiple story arcs. And there is a check box for an "alternate" method. Only try that if the matches don't come out right. It is also looking for a minimum story arc string length of 5. That helps cut out some false positives. And it is setup as a constant in the script file if you want to change it.

    Just do it on one Series, I haven't tested it with more than one. But you shouldn't do that anyway if you know what story arcs are



    V0.8.0 Details Here are some screenshots of what happens when processing books that have a detected story arc that is also listed in alternate series.

    Data as downloaded from Comicvine -


    Make sure you check overwrite to enable this feature -


    Results for the script -
    Attachments:
    Last Edit: 3 years 9 months ago by Freakeao.
    The administrator has disabled public write access.
    The following user(s) said Thank You: 600WPMPO, Yellowbox, James Spaceman, Edtion, adamf9898

    Re: New Script: Get Story Arc From Titles 4 years 10 months ago #28621

    • Yellowbox
    • Yellowbox's Avatar
    • Offline
    • Junior Boarder
    • Posts: 25
    • Thank you received: 10
    • Karma: 3
    That looks pretty swanky! Excited to try it out this weekend. Glad I could inspire such brilliance, pal. :woohoo: (And it only took a couple days short of a year for it to happen!)
    The administrator has disabled public write access.

    Re: New Script: Get Story Arc From Titles 4 years 10 months ago #28623

    • 600WPMPO
    • 600WPMPO's Avatar
    • Offline
    • Moderator
    • Posts: 3788
    • Thank you received: 557
    • Karma: 232
    Useful script! +1 karma for all the good work! :-)
    Freakeao wrote:
    Let me know if there are any goofy outcomes or errors.

    Here are my thoughts about this nice script:

    Trying it on the last few books of 'The Boys' series..



    If I select issues 66-71 (all belonging to a common story arc), it does its job well...





    If I select issues 66-72, overlapping story arcs, it falters a little...





    Ultimately I get my 'The Boys' story arced well!




    Suggestions & Feature Requests:

    Better handling for books with different story arcs, so that we get the ability to batch select multiple books belonging to different story arcs, and the script 'automagically' selects the relevant groups of books & gives suggestions about their proposed story arcs one by one.

    Icon in the Browser toolbar, so that we don't have to repeatedly go to the right-click automation menu.




    p.s. And any script that brings our veteran user Yellowbox back to the forums has to be really good! ;-)
    Now Playing: The ComicRack Manual (Online)

    See my new comics & gadgets on: Tumblr!
    The administrator has disabled public write access.
    The following user(s) said Thank You: Yellowbox

    Re: New Script: Get Story Arc From Titles 4 years 10 months ago #28628

    • 600WPMPO
    • 600WPMPO's Avatar
    • Offline
    • Moderator
    • Posts: 3788
    • Thank you received: 557
    • Karma: 232
    Ok...I have updated this to v0.2 (hope Freakeao won't mind :unsure: )

    File Attachment:

    File Name: Story Arc ...crplugin
    File Size:4 KB


    Now it has its own icon (I can change this icon to a better one , if people feel so..) & a place on the Browser toolbar too! :)







    Edit:

    I found a 'bug'! :P

    Now Playing: The ComicRack Manual (Online)

    See my new comics & gadgets on: Tumblr!
    Last Edit: 4 years 10 months ago by 600WPMPO.
    The administrator has disabled public write access.

    Re: New Script: Get Story Arc From Titles 4 years 10 months ago #28629

    • Freakeao
    • Freakeao's Avatar
    • Offline
    • Gold Boarder
    • Posts: 199
    • Thank you received: 25
    • Karma: 6
    600WPMPO wrote:
    Suggestions & Feature Requests:

    Better handling for books with different story arcs, so that we get the ability to batch select multiple books belonging to different story arcs, and the script 'automagically' selects the relevant groups of books & gives suggestions about their proposed story arcs one by one.

    Icon in the Browser toolbar, so that we don't have to repeatedly go to the right-click automation menu.

    I think an icon would be a good addition. I just don't know how to do that yet. I'm still very new to ComicRack Scripts. But I will look into it. Or if someone has a pointer that would be great. Do I just have to add an Image to Package.ini ?

    As for handling more than one story arc at a time, that is exactly what it isn't designed to do. As you point out it can only handle one story arc at a time correctly. I'll have to think if there is a way to get it to do more than one at a time.

    Thanks for the karma. Do I get to cash those in for a pony someday? ;)
    The administrator has disabled public write access.

    Re: New Script: Get Story Arc From Titles 4 years 10 months ago #28630

    • Freakeao
    • Freakeao's Avatar
    • Offline
    • Gold Boarder
    • Posts: 199
    • Thank you received: 25
    • Karma: 6
    600WPMPO wrote:
    I found a 'bug'! :P


    It is very sensitive and case sensitive.

    I don't mind at all about the v0.2
    The administrator has disabled public write access.

    Re: New Script: Get Story Arc From Titles 4 years 10 months ago #28631

    • 600WPMPO
    • 600WPMPO's Avatar
    • Offline
    • Moderator
    • Posts: 3788
    • Thank you received: 557
    • Karma: 232
    Freakeao wrote:
    I don't mind at all about the v0.2
    The icon is Ok, or shall I search for a better one..? :unsure:
    Now Playing: The ComicRack Manual (Online)

    See my new comics & gadgets on: Tumblr!
    The administrator has disabled public write access.

    Re: New Script: Get Story Arc From Titles 4 years 10 months ago #28632

    • Freakeao
    • Freakeao's Avatar
    • Offline
    • Gold Boarder
    • Posts: 199
    • Thank you received: 25
    • Karma: 6
    It's fine with me. Unless someone can think of a more appropriate one, which I can't at the moment.
    The administrator has disabled public write access.

    Re: New Script: Get Story Arc From Titles 4 years 10 months ago #28634

    • 600WPMPO
    • 600WPMPO's Avatar
    • Offline
    • Moderator
    • Posts: 3788
    • Thank you received: 557
    • Karma: 232
    Freakeao wrote:
    As for handling more than one story arc at a time, that is exactly what it isn't designed to do. As you point out it can only handle one story arc at a time correctly. I'll have to think if there is a way to get it to do more than one at a time.
    Fair enough. But, if it can't get more than one story arcs, then. it shouldn't detect possible story arcs in such a scenario. It should say "Multiple story arcs detected. Please re-select", or some hing like that.
    Freakeao wrote:
    Do I get to cash those in for a pony someday? ;)
    When you get sufficient karma, you get a free visit to cYo labs! :laugh:
    Now Playing: The ComicRack Manual (Online)

    See my new comics & gadgets on: Tumblr!
    The administrator has disabled public write access.

    Re: New Script: Get Story Arc From Titles 4 years 10 months ago #28635

    • Freakeao
    • Freakeao's Avatar
    • Offline
    • Gold Boarder
    • Posts: 199
    • Thank you received: 25
    • Karma: 6
    600WPMPO wrote:
    But, if it can't get more than one story arcs, then. it shouldn't detect possible story arcs in such a scenario. It should say "Multiple story arcs detected. Please re-select", or some hing like that.

    I think you think the script is smarter than it is. If it knew there were multiple story arcs we wouldn't have this problem. But I think I may have a solution. I'll post an update in a day or two.
    The administrator has disabled public write access.
    Time to create page: 0.416 seconds

    Who's Online

    We have 260 guests and 3 members online