From 385ad06773d6fcfab6d285f1093638114b6e524c Mon Sep 17 00:00:00 2001 From: FrederikBaerentsen Date: Thu, 29 Jan 2026 20:12:58 +0100 Subject: [PATCH] Added List Book Properties plugin --- List Book Properties/DebugProps.py | 45 ++++++++++++++++++++++++++++++ List Book Properties/Package.ini | 4 +++ README.md | 4 +++ 3 files changed, 53 insertions(+) create mode 100644 List Book Properties/DebugProps.py create mode 100644 List Book Properties/Package.ini diff --git a/List Book Properties/DebugProps.py b/List Book Properties/DebugProps.py new file mode 100644 index 0000000..da8ecca --- /dev/null +++ b/List Book Properties/DebugProps.py @@ -0,0 +1,45 @@ +import clr +clr.AddReference("System.Windows.Forms") +clr.AddReference("System") +from System.Windows.Forms import MessageBox +from System.IO import Path, File, StreamWriter + +# ============================================================================== +# @Name Debug: List Book Properties +# @Hook Books +# @Key debug-props +# ============================================================================== +def ListBookProperties(books): + if not books: + MessageBox.Show("No books selected!") + return + + b = books[0] # Just use the first book + + # Get all properties using .NET reflection + props = [] + for prop in b.GetType().GetProperties(): + print(prop.Name,prop.GetValue(b, None)) + + try: + val = prop.GetValue(b, None) + props.append("%s = %s" % (prop.Name, val)) + except: + props.append("%s = (error reading)" % prop.Name) + + # Also get methods + methods = [] + for method in b.GetType().GetMethods(): + methods.append(method.Name) + + # Write to file since MessageBox can't show all + output_path = Path.Combine(Path.GetDirectoryName(__file__), "book_properties.txt") + with open(output_path, 'w') as f: + f.write("=== PROPERTIES ===\n") + for p in sorted(props): + f.write(p + "\n") + f.write("\n=== METHODS ===\n") + for m in sorted(set(methods)): + f.write(m + "\n") + + MessageBox.Show("Properties written to:\n" + output_path) diff --git a/List Book Properties/Package.ini b/List Book Properties/Package.ini new file mode 100644 index 0000000..cba89d4 --- /dev/null +++ b/List Book Properties/Package.ini @@ -0,0 +1,4 @@ +Name=List Book Properties +Author=Frederik Baerentsen +Version=1.0 +Description=Export a file of all the book properties \ No newline at end of file diff --git a/README.md b/README.md index 330326e..9876b7b 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,10 @@ Fixed FromDucks version from https://www.reddit.com/r/comicrackusers/comments/vi Backup of my Library Organizer files +## List Book Properties + +Simple plugin script to export a .txt file of all book properties possible from ComicRack. + ## Manuals Backup of ComicRack manuals