Welcome, Guest
Python Scripts for ComicRack

TOPIC: Data Manager 2.xx Series for ComicRack

Data Manager 2.xx Series for ComicRack 6 months 2 weeks ago #47605

  • Surfal666
  • Surfal666's Avatar
  • Offline
  • Senior Boarder
  • Posts: 64
  • Thank you received: 4
  • Karma: 2
Right now the majority of those rules deal with Scanners, because I didn't like the way the ScannerInformation plugin worked...
<ruleset name="The Magicians" rulesetmode="AND">
<rule field="FileName" modifier="ContainsAnyOf" value="(The Magicians-Novus)||(The Magicians - Novus)||(Novus-The Magicians)||(Novus - The Magicians)||(TheMagicians-Empire)" />
<rule field="ScanInformation" modifier="NotContains" value="Novus:The Magicians" />
<action field="ScanInformation" modifier="SetValue" value="Novus:The Magicians" />
</ruleset>
(I did try these with regexs originally and it was far more cumbersome than simple text matching. I've gone so far as to write a script that writes these rules for me, and a script that writes that script based off mass-parsing the file names of the books... There are days where I've got time to kill, mkay?)

As for crowdsourced rules:
<group name="Marvel">
      <filtersanddefaults rulesetmode="AND">
        <rule field="Publisher" modifier="Is" value="Marvel" />
      </filtersanddefaults>
      <group name="Defaults">
        <filtersanddefaults rulesetmode="AND" />
        <ruleset name="Max:Age Rating" comment="All books with the Marvel Max imprint are Mature titles." rulesetmode="AND">
          <rule field="Imprint" modifier="Is" value="Max" />
          <action field="AgeRating" modifier="SetValue" value="Mature 17+" />
        </ruleset>
      </group>
      <group name="Titles">
        <filtersanddefaults rulesetmode="AND" />
        <ruleset name="Amazing Spider-Man: Renew Your Vows (2016)" rulesetmode="AND">
          <rule field="Series" modifier="Is" value="Amazing Spider-Man: Renew Your Vows" />
          <rule field="Volume" modifier="Is" value="2016" />
          <action field="AgeRating" modifier="SetValue" value="Teen" />
          <action field="Genre" modifier="Add" value="Super-Hero" />
          <action field="MainCharacterOrTeam" modifier="SetValue" value="Spider-Man (Peter Parker)" />
        </ruleset>
      </group>
      <group name="Events">
        <filtersanddefaults rulesetmode="AND" />
        <ruleset name="AvX" rulesetmode="AND">
          <rule field="Series" modifier="StartsWithAnyOf" value="Avengers Vs. X-Men||AVX||Avengers vs. X-Men||AvX||A+X||A-Babies vs. X-Babies" />
          <action field="Event" modifier="SetValue" value="AvX" />
        </ruleset>
      </group>
    </group>

There are other fields like Count, Series Completed, Language, Manga, Black and White, and Price that can be filled in as well. Basically, anything that we don't / can't pull from the CVDB. Events are an idea that I borrowed from 600WPMPO's Organizer handbook, and make the construction of reading lists a much simpler task.

Those are the ideas that I think might apply for a large number of users. I've got other rule sets that set the BookAge, try to set the Format, manipulate Series/Title for one-shots and switch off proposed values that are probably less universal in appeal but still could be useful to someone.
Last Edit: 6 months 2 weeks ago by Surfal666. Reason: Clarity
The administrator has disabled public write access.

Data Manager 2.xx Series for ComicRack 6 months 2 weeks ago #47607

  • T3KN0Gh057
  • T3KN0Gh057's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 407
  • Thank you received: 114
  • Karma: 27
jkthemac wrote:
Surfal666 wrote:
T3KN0Gh057 wrote:
This will also make it easier for me to institute downloadable profiles in the repository.
Oh man - you dont know how bad I wanted this. I've got ~6200 rules in my default profile now, and I suspect that I'm not the only obsessive guy out here. Crowdsourcing things like series metadata will be so much easier...

You totally rock.
6200! That does sound just a little bit obsessive.

What are you thinking in regards to crowdsourcing? I have considered making rules that compact wider data into the xml file, but distributing them in a way that can easily be applied to multiple files is a little more tricky. That would certainly require a specific script to strip out data and compile it, and then to distribute it.

I have often thought this would be a good idea for reading lists. Allowing a way to get all of the data from one database to another, and providing us with a standardised way of dealing with reading lists that didn't rely upon ordered lists or smart lists.

Well the way profiles are handle is going to change by the point downloadables are available: each profile will load from its own xml file in a 'profiles' folder of the script. Honestly that's a way off though.
The administrator has disabled public write access.

Data Manager 2.xx Series for ComicRack 6 months 1 week ago #47619

  • opeth2112
  • opeth2112's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 10
  • Karma: 0
I just updated my plugin from 2-03-48r770 to 2.04.05.r785, and when I try to run it - it sits on the first comic and never completes. Is there a way to pull a log file to see what might be happening?

Thanks for your work on this btw!
The administrator has disabled public write access.

Data Manager 2.xx Series for ComicRack 6 months 1 week ago #47620

  • opeth2112
  • opeth2112's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 10
  • Karma: 0
opeth2112 wrote:
I just updated my plugin from 2-03-48r770 to 2.04.05.r785, and when I try to run it - it sits on the first comic and never completes. Is there a way to pull a log file to see what might be happening?

Thanks for your work on this btw!

Actually I located the log file - it only has the time and date I updated the plugin, so appears to not be receiving any info from the plugin.
The administrator has disabled public write access.

Data Manager 2.xx Series for ComicRack 6 months 1 week ago #47626

  • opeth2112
  • opeth2112's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 10
  • Karma: 0
So I re-installed the 2.x version, and when I tried to import my rules from 1.x - I got the following. Does this have to do with your move to XML, and is there something different I can do to remedy this?
See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Xml.XmlException: Name cannot begin with the '<' character, hexadecimal value 0x3C. Line 1, position 2.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
   at System.Xml.XmlTextReaderImpl.ParseQName(Boolean isQName, Int32 startOffset, Int32& colonPos)
   at System.Xml.XmlTextReaderImpl.ParseElement()
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.XmlReader.MoveToContent()
   at System.Xml.Linq.XElement.Load(XmlReader reader, LoadOptions options)
   at System.Xml.Linq.XElement.Parse(String text, LoadOptions options)
   at System.Xml.Linq.XElement.Parse(String text)
   at DataManagerGUI.dmRuleset.FromXML(String xString)
   at DataManagerGUI.dmRuleset.set_OriginalText(String value)
   at DataManagerGUI.dmRuleset.Parse(String strRule)
   at DataManagerGUI.dmContainer.ParseRuleset(String[] strArray, Int32 nLineStart, dmContainer dmcParent)
   at DataManagerGUI.dmContainer.ParseGroup(String[] strArray, Int32 nLineStart, dmContainer Parent)
   at DataManagerGUI.dmContainer.ParseGroup(String[] strArray, Int32 nLineStart, dmContainer Parent)
   at DataManagerGUI.dmCollection.Import(String[] masterRules)
   at DataManagerGUI.gui.tsmiProfileImport_Click(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1648.0 built by: NETFXREL3STAGE
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
crdmgui
    Assembly Version: 2.4.5.785
    Win32 Version: 2.04.05.785
    CodeBase: file:///C:/Users/Jason/AppData/Roaming/cYo/ComicRack/Scripts/Data%20Manager/crdmgui.exe
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1647.0 built by: NETFXREL3STAGE
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1647.0 built by: NETFXREL3STAGE
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Xml.Linq
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1586.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

The administrator has disabled public write access.

Data Manager 2.xx Series for ComicRack 6 months 1 week ago #47627

  • opeth2112
  • opeth2112's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 10
  • Karma: 0
URGH - never mind on all this. I finally found the couple posts that gave some clarity, and it seems I need to install an older 2.x version to use to import and save my old 1.x rules. Carry on...
Last Edit: 6 months 1 week ago by opeth2112. Reason: spelling
The administrator has disabled public write access.

Data Manager 2.xx Series for ComicRack 6 months 1 week ago #47628

  • opeth2112
  • opeth2112's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 10
  • Karma: 0
OK - so I think I am at an actual problem I can't get around. I was able to get all my rules imported and converted to the new format (basically just using the original rules from the Library Organizer instructional deal from this forum) so no oddball rules to worry about at this point. I try to run the script and the log shows the following and just hangs :
2017.05.31 05:28:16 ##Checking for Running Instance
2017.05.31 05:28:16 ##Enabling Visual Styles...
2017.05.31 05:28:17 ##Setting Compatible Text Rendering to false...
2017.05.31 05:28:17 ##Starting GUI...
2017.05.31 05:28:17 ##Setting Paths...
2017.05.31 05:28:17 ##Data Manager Path is: C:\Users\Jason\AppData\Roaming\cYo\ComicRack\Scripts\Data Manager\
2017.05.31 05:28:17 ##Data Manager Default Rule File is: C:\Users\Jason\AppData\Roaming\cYo\ComicRack\Scripts\Data Manager\dataman.dat
2017.05.31 05:28:17 ##User File path is: C:\Users\Jason\AppData\Roaming\cYo\ComicRack\Scripts\Data Manager\user.ini
2017.05.31 05:28:17 ##Verifying files...
2017.05.31 05:28:17 ##Setting FieldType Limitations...
2017.05.31 05:28:17 ##Initializing Controls
2017.05.31 05:28:18 ##Loading user file
2017.05.31 05:28:18 ##Filling tree items...
2017.05.31 05:28:18 ##Loading default Ruleset Collection
2017.05.31 05:28:19 ##Filling Combo boxes...
2017.05.31 05:28:19 ##Setting default combobox items...
2017.05.31 05:28:19 ##Loading default Ruleset Collection..
2017.05.31 05:28:19 ##Setting versions...
2017.05.31 05:28:19 ##Showing GUI to user
2017.05.31 05:28:24 ##Ensuring only a single instance is allowed...

Any thoughts? Thanks!
The administrator has disabled public write access.

Data Manager 2.xx Series for ComicRack 6 months 2 weeks ago #47629

  • Surfal666
  • Surfal666's Avatar
  • Offline
  • Senior Boarder
  • Posts: 64
  • Thank you received: 4
  • Karma: 2
opeth2112 wrote:
Any thoughts? Thanks!

1) Hi Jason!
2) Are you running against a single book or a group? (Try a single book.)
3) Disable all your current rules, and create a fresh one that does something simple. Does that rule run?
4) Dupe a book in your library (so it doesnt matter if you mess it up) and start re-enabling rules... Keep running them against that one book until either it breaks or you've re-enabled everything. If it breaks, you've found the rule... try it against a different book and see if the outcome changes.

Also from Writing ComicRack scripts:
To make it simpler debugging your script you should start ComicRack with the following command line:

ComicRack.exe -dso -ssc

The meaning of these switches is:

-dso is Disable Script Optimization
Scripts are always reloaded when executed. Otherwise they are compiled once during startup.
-ssc is Show Script Console
With this you get a look at all your script output (good for debugging messages).

You could also post the ruleset,.
The administrator has disabled public write access.

Data Manager 2.xx Series for ComicRack 6 months 2 weeks ago #47630

  • opeth2112
  • opeth2112's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 10
  • Karma: 0
Started adding them back, and this rule causes a hang up.

Errors out :
<ruleset name="Fantastic Four" rulesetmode="AND"> <rule field="Publisher" modifier="Is" value="Marvel" /> <rule field="Series" modifier="ContainsAllOf" value="Fantastic Four" /> <action field="SeriesGroup" modifier="SetValue" value="Marvel Main Series" /> <action field="MainCharacterOrTeam" modifier="SetValue" value="Fantastic Four" /></ruleset>

Works :
<ruleset name="Fantastic Four" rulesetmode="AND"> <rule field="Publisher" modifier="Is" value="Marvel" /> <rule field="Series" modifier="Contains" value="Fantastic Four" /> <action field="SeriesGroup" modifier="SetValue" value="Marvel Main Series" /> <action field="MainCharacterOrTeam" modifier="SetValue" value="Fantastic Four" /></ruleset>

What would be the difference between the two that would cause an issue? I tried adding a couple options in case "ContainsAllOf" had to have multiple choices, but didn't matter.
The administrator has disabled public write access.

Data Manager 2.xx Series for ComicRack 6 months 1 week ago #47631

  • opeth2112
  • opeth2112's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 10
  • Karma: 0
UPDATE :
--working--
ContainsAnyOf
NoContainsAnyOf
Contains
NotContains

--not working--
ContainsAllOf
NotContainsAllOf

Both non-working show the last log entry as "2017.06.01 08:09:37 ##Ensuring only a single instance is allowed...".
opeth2112 wrote:
Started adding them back, and this rule causes a hang up.

Errors out :
<ruleset name="Fantastic Four" rulesetmode="AND"> <rule field="Publisher" modifier="Is" value="Marvel" /> <rule field="Series" modifier="ContainsAllOf" value="Fantastic Four" /> <action field="SeriesGroup" modifier="SetValue" value="Marvel Main Series" /> <action field="MainCharacterOrTeam" modifier="SetValue" value="Fantastic Four" /></ruleset>

Works :
<ruleset name="Fantastic Four" rulesetmode="AND"> <rule field="Publisher" modifier="Is" value="Marvel" /> <rule field="Series" modifier="Contains" value="Fantastic Four" /> <action field="SeriesGroup" modifier="SetValue" value="Marvel Main Series" /> <action field="MainCharacterOrTeam" modifier="SetValue" value="Fantastic Four" /></ruleset>

What would be the difference between the two that would cause an issue? I tried adding a couple options in case "ContainsAllOf" had to have multiple choices, but didn't matter.
Last Edit: 6 months 1 week ago by opeth2112. Reason: formatting
The administrator has disabled public write access.
Time to create page: 0.207 seconds

Who's Online

We have 212 guests and one member online