Welcome, Guest
Python Scripts for ComicRack

TOPIC: Standardize Library Script Tweaked

Re:Standardize Library Script Tweaked 8 years 5 months ago #3770

  • perezmu
  • perezmu's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1114
  • Thank you received: 64
  • Karma: 51
Thanks for the update
The administrator has disabled public write access.

Re:Standardize Library Script Tweaked 7 years 10 months ago #5142

  • doolittle
  • doolittle's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 16
  • Karma: 0
Thanks to DouglasBubbleTrousers and oraclexview for this script. It's one of my favorites.

*****************************
Here's an embarrassing story about me trying to mess with this code
*****************************

Though I'd never seen Python before, I tried tonight to tweak this script a little to fit my tastes. All I wanted to do was add the title into the filename after the issue #.

"How hard can this be? I'm only adding one thing," I thought to myself, foolishly.

Popped the .py file open, had a look around. Oracle writes very organized code with informative comments, so it was easy to follow for a noobert such as myself. Everything seemed pretty straightforward. The variable name I needed was easy enough to figure out (title).

Twenty minutes later, I had my code ready to go. I was feeling good. I tried it out on the first book in my collection - 100 Bullets #1 - and it actually worked!

Kind of.

Instead of putting the title after the issue #, it was adding the series again... 100 Bullets #1 - 100 Bullets. While I was happy the code was doing SOMETHING, it wasn't what I wanted, so I dove back in. Frustration quickly set in. I didn't really have any idea what I was doing, so it was blind trial and error. And error and error and error.

Two hours later, I was ready to give up. Why would the title and series variables point to the same data? Having nothing to go on other than guesses, how was I going to figure out the correct variable name? I was at loss.

Finally, I went back to the original code I had, the one that had almost, kind of worked. I tried it on the second and third comics in my collection, 100 Bullets #2 and #3. Same result... 100 Bullets #2 - 100 Bullets, 100 Bullets #3 - 100 Bullets.

I was about to throw my laptop into the street when the actual title of the first arc of 100 Bullets caught my eye.

The first arc of 100 Bullets is titled... oh yeah... 100 Bullets.

The code was working the whole time. It turns out I'm an idiot that doesn't pay attention to what he's doing, and winds up wasting hours trying to fix code that already works.

I think I'll leave the scripting to the experts from now on. :unsure:
"i aim to misbehave."
Last Edit: 7 years 10 months ago by doolittle.
The administrator has disabled public write access.

Re:Standardize Library Script Tweaked 7 years 10 months ago #5144

  • oraclexview
  • oraclexview's Avatar
  • Offline
  • Moderator
  • aka SoundWave
  • Posts: 907
  • Thank you received: 182
  • Karma: 37
Hey doolittle. I mos def wouldn't call myself an expert by any means. And I, as I'm sure many others here, have also wasted hours on coding (whichever language it may be in) only to realize you missed one little thing that could have save you soooo much time. It's the nature of the beast. For me personally though, I find it all to be worth it once you have it working and even more once others get a benefit from it as well.

I congratulate you on your tweak and I encourage you to continue learning more when it suits your needs because I find Python to be one of the easier and quicker languages to learn and implement.

And trust me, the stuff I'm working on now is taking me forever to post up here because I am also a newbie at this language. But, there is more to come that I hope is just as useful as this was for you!

Cheers!
The administrator has disabled public write access.

Re:Standardize Library Script Tweaked 7 years 10 months ago #5159

  • perezmu
  • perezmu's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1114
  • Thank you received: 64
  • Karma: 51
oraclexview wrote:
And trust me, the stuff I'm working on now is taking me forever to post up here because I am also a newbie at this language. But, there is more to come that I hope is just as useful as this was for you!

Hint, hint???
The administrator has disabled public write access.

Re:Standardize Library Script Tweaked 7 years 10 months ago #5171

  • oraclexview
  • oraclexview's Avatar
  • Offline
  • Moderator
  • aka SoundWave
  • Posts: 907
  • Thank you received: 182
  • Karma: 37
perezmu wrote:
Hint, hint???

Lol, how could I say no to that request. Well, it's partially because I'm lazy and painfully anal at the same time coupled with the fact that I like learning new languages that can quickly assist me in what I'm doing, that I've been working on a few new ideas (that some may have tackled already to some degree).

One idea, is that I love the idea of ComicRack renaming the eComics to CBZ format from CBR so that you can store metadata within each file. However, I didn't like how it renamed all the image files in the archive file to generic names. So I've been working on a vbscript ran through ComicRack (later to be converted to IronPython) which renames all CBR files within a directory tree to CBZ files without changing the names of the image files within. I've got that working, but now I'm going to also have it, as an option, to rename the image files within to match the name of the file name and page number as well as retain the ComicRack info for files previously updated with info in the library. Perezmu, I also will try to eventually incorporate your great status bar function so that it'll give an idea of how long it's taking to run/execute.

Second idea I'm currently working on, is I want to expand on your "pull scanner type and name from file name" script perezmu, so that the user doesn't have to know anything about regular expressions (or at least as little as possible) but can still dynamically and new names to the list of scanners without directly editing the script. This has evolved from the idea that once I started learning about regular expressions, I realized that, even though they are very powerful and extremely useful for pulling what you need, they are quit difficult to learn and make common sense of for the average. So I figured, lets make an app for that (Err, excuse me, still hung over from the Apple hype of late), I mean a script for that so people need to as little as possible about scripting and especially about regex!

The third idea will be to combine this basic rename file script with my more involved rename file script to let the user decide to use either or again, without having to load both scripts separately. Also, I love wadegiles all-in-wonder rename file script, so mines will eventually be very similiar, but hopefully a little more simple looking to the user who may fill a little overwhelmed by the many options. I will also be adding all the great ideas from Alan Scott, Nogatrh, and pcvii to name a few.

Finally, a much later idea, is to create a script that helps ComicRack to maintain multiple story arcs within a single eComic file, and group together the related elements of each story arc including but not limited to penciler, inker, writer, colorist, character appearances, and misc. notes. This at this point is only in the brainstorming stage.

That's what I've been working on or planning this past month.
Last Edit: 7 years 10 months ago by oraclexview.
The administrator has disabled public write access.

Re:Standardize Library Script Tweaked 7 years 10 months ago #5175

  • perezmu
  • perezmu's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1114
  • Thank you received: 64
  • Karma: 51
I want them all!!!!!
The administrator has disabled public write access.

Re:Standardize Library Script Tweaked 7 years 10 months ago #5177

  • Stonepaw
  • Stonepaw's Avatar
  • Offline
  • Moderator
  • Posts: 921
  • Thank you received: 268
  • Karma: 173
I'm looking forward to all your scripts! I don't know about you put I'm finding creating the scripts for this programs is more interesting then actually reading the comics :lol:
Last Edit: 7 years 10 months ago by Stonepaw.
The administrator has disabled public write access.

Re:Standardize Library Script Tweaked 7 years 10 months ago #5188

  • oraclexview
  • oraclexview's Avatar
  • Offline
  • Moderator
  • aka SoundWave
  • Posts: 907
  • Thank you received: 182
  • Karma: 37
Lol, and Stonepaw, I have to agree, that I've found learning and creating the scripts to be more interesting than reading the books I'm creating them for as well. I think that is in large part do to cYo's wonderful and hugely useful app (which I must say is the image file equivalent to MediaMonkey for audio files) and to this great user community!

I was thinking of posting here in the scripts section the first stage of my first new script so that a few others may help me test it out before I expand upon it further.
The first one I'm currently working on the most is grabbing all CBR files in a directory and its sub-directories and either converting them or copying them to CBZ files.
This first stage just grabs each CBR or CBZ file in the user selected directory and logs each found file to either a text file or a Excel file. I have this stage working, but I must admit I've run into issues when running it against a LARGE directory of eComic CBR & CBZ files.

So let me know if any of you think it's a good idea to post this test script who are willing to help me test it in their environment and provide feedback, good or bad.

It's all about learning and assisting! That's how we all grow!
Thanks everyone!
Last Edit: 7 years 10 months ago by oraclexview.
The administrator has disabled public write access.

Re:Standardize Library Script Tweaked 7 years 10 months ago #5189

  • Stonepaw
  • Stonepaw's Avatar
  • Offline
  • Moderator
  • Posts: 921
  • Thank you received: 268
  • Karma: 173
I'd say go ahead and post what you have. I'd be happy to help test your scripts.
The administrator has disabled public write access.

Re:Standardize Library Script Tweaked 7 years 10 months ago #5190

  • oraclexview
  • oraclexview's Avatar
  • Offline
  • Moderator
  • aka SoundWave
  • Posts: 907
  • Thank you received: 182
  • Karma: 37
Ok, then I'm going to start a new thread and post the test script there for any and all who would like to help me with feedback. I'll also post a link here to the new thread as well.
The administrator has disabled public write access.
Time to create page: 0.402 seconds

Who's Online

We have 250 guests and 2 members online