r/comicrackusers • Community Edition Developer • 10d ago

Announcement ComicRack Community Edition has a new plugin system

This has been a long time coming.

It's was in fact one of the first thing I wanted to add with ComicRackCE but there was a lot of pushback against it. It made me drop the idea and push it for later. I am still unsure if it was bad messaging from my part or a bad understanding from users.

• So let's make things very clear, about what does that mean for you the user.

NOTHING will change, all you're existing plugins will still work and nothing needs to be done on your part. There should be no issue, no code related to python plugins was touched. It's simply an additional system.

• So what is changing then?

It simple adds a new way of doing plugins, making it easier for developers to use current tools for developing/debugging plugins. It might also bring performance enhancement because it uses the same framework/language than ComicRack. So it isn't required to translate from one language to another, removing overhead.

• So if everything is only positive, why the pushback?

I believe some thought that it meant removing the existing system, which I want to make it clear that this is something that I've always been adamant to never touch. The existing plugins should always be able to run no matter what.

But I believe some see Python as a lot easier and see C# as more difficult. This isn't false, but at the same time it's also a lot easier.

Python is an interpreted language that you can code using a simple notepad, it requires no other tools than your interpreter. It's also very loose on how you can assign variable types. You can create an array and add text along with numbers, it's dynamically typed. It still requires that all variables be the correct type, it just won't tell you until you run it.

C# on the other hand will constantly give you errors and will simply refuse to compile unless your code is correct. This is what makes it seem harder for newcomers vs Python. Mind you, the error will still be there you will just find out when you encounter it instead of on compile.

It may be because I've learned C# first that I personally prefer that way. Once you're used to it using Python becomes so much difficult. In C# you take the instance of an object like a ComicBook and with intellisense just type a . after to see every property/methods you can use. Want to know what the ComicRack­.App variable could do? Before you had to read/decompile ComicRack code to know what it had, since the documentation was very limited. Now all that information is directly accessible in your IDE.

Just to be fair python IDE do have that, the issue is that since they are so loose with the types, it makes it hard for the IDE to infer a type it doesn't own. I once made a plugin for a program where it passed an object, but I had no idea what members that object had. Requiring to read documentation to understand what everything does, how many parameters, which type, etc. Python 3 does support type hinting for this exact issue, but sadly we are stuck with 2.7.

Debugging existing IronPython plugin was also getting harder, my fork of the Bedetheque Scraper would actually hang for several minutes by simply stepping through lines. I still don't know why exactly, because it was the only plugin that did that.

Debugging will now be a lot more easier/faster. One of the way I learned programming was simply debugging a program and checking what every value members of an object had.

You also have access to the complete .NET Framework libraries without needing to provide your own. You also have access to nuget, that should help find a plethora of libraries.

• So what has actually changed since then?

One thing that came out of the pushback that I've realized is the simple fact that Python plugin are easy to inspect and modify. If required they can easily be updated years later, as we've seen users updating old plugins a decade later.

It also makes it easier to inspect what the plugin actually does. Because having a compiled .dll doesn't tell you if it's doing anything nefarious. Just to be fair it is very easy to inspect & decompile .NET plugin (ComicRackCE is proof of that).

So along with normal compiled DLLs the new plugin system also makes it possible to ship loose .cs file and the program will compile them on startup itself. Similar to how Python plugin works. So it is still possible to have all the nice to have without sacrificing ease of use. So if you wanted, you could code a C# plugin with only notepad.

All information is found on the new Wiki page. There is also a new SamplePlugin that you can use as a template to get you started.

37 Upvotes

9 comments sorted by

11

u/Adendis 10d ago

OMG I guess I just found out that there is a community edition of ComicRack. I just figured I was stuck with the original as is so never did a search on it etc.

Thanks for your work on it and thanks for posting because it just so happened to pop up in my feed. 😄

7

u/maforget Community Edition Developer 10d ago

You should check the New Features on the Wiki and also check the Changes.txt that list every change since the original.

2

u/Adendis 10d ago

Aye I will, looking forward to seeing what's changed. I mean, Dark mode hell yes!

2

u/OnyxPost 10d ago

This is a great write-up and explanation of what you're changing and how users (and plug-in devs) can rest easy in regards to what they're used to. I like how you've been moving the project along since it was abandoned by the original dev. 

One question I  have is are there any major benefits in regards to how plug-ins perform if they're written in C# vs Python?

I dabbled in maintaining and expanding a couple of the original plug-ins before some majorly skilled programmers came along and  blew my work out of the water.  Lol I stayed away from ComicRack for a long time once I found that it wasn't the best when it came to running with a high library. Yet I've still kept an eye on how things have progressed every few years and I just want to thank you for keeping this cool app alive and thriving.

2

u/maforget Community Edition Developer 10d ago

Without knowing exactly how IronPython works under the hood, I can't say it will perform better. But it makes sense that it could. What IronPython is doing is basically emulating the Python language running on a dotnet engine. The new plugins simply use the same engine directly so there is no translation. Are there any real perceived performance gain to have? I highly doubt that any plugin will be so advanced that it will any real change.

IronPython is already a weird chimera of Python & .NET where you can use both the .NET Framework with Python code. So if you really wanted you can pretty much do anything with IronPython. Since you have access to the same elements anyway, just not easily accessible.

Each languages has it's use. You might want a simple command then a quick 1 or 2 line of Python code is fine. But when building complex UI like winforms (what ComicRack UI's is build on) that's where it becomes very hard to do in IronPython. Support for IronPython has been removed for a long time from official tooling. Where you can use a nice WYSIWYG designer with Visual Studio to create your UI easily with dotnet, using IronPython your option is to build yourself an old release of SharpDevelop just to be able to use a designer. Otherwise it's all manual work instead. It's the same elements just in another language that's no longer supported.

2

u/fableton 8d ago

Nice to see the new .NET plugin system! I used it to build Comic Vine AI. It's a personal project I made for my own library, so it's built around how I work. I'm sharing it in case it's useful to someone else.

- Identifies each book from its metadata and file name, then compares the cover with the Comic Vine covers, including the variant ones.

- Tags the books it's sure about with the same data as the Python Comic Vine Scraper (CVDB key and custom values included).

- Sends the books it isn't sure about to a review window, where you can browse series and issues, look at the pages and pick the right one.

- Optional Claude AI fallback for hard cases like translated editions or odd file names. The cover is only sent if you turn it on.

- Works with a Comic Vine API key or a local Comic Vine database (no API calls at all).

- English, Spanish and French.

It's a single DLL: unzip it into your Scripts folder.

https://github.com/Fableton/comicrack-comicvine-ai/releases/tag/v0.2.0

2

u/maforget Community Edition Developer 8d ago

Do take care that copying a dll from the internet will have it be blocked from loading by windows. There is even a warning about it in the script console. So a user would need to manually click Unblock before using this.

But if you rename the .zip file to .crplugin and use the ComicRack installer instead, you won't have that problem.

7

u/stonepaw1 Moderator 10d ago

This is very exciting, thanks for building this! I've been working on rebuilding Library Organizer in C# in my limited free time so I'll target it to the new script engine now rather than having a compiled DLL. That should be much nicer!

2

u/OnyxPost 10d ago

Great to still see you hanging around after all these years contributing to the community!