Welcome, Guest
Python Scripts for ComicRack

TOPIC: malor89's Perl Scripts

Re: malor89's Perl Scripts 6 years 6 months ago #12969

  • flips
  • flips's Avatar
  • Offline
  • Senior Boarder
  • Posts: 45
  • Thank you received: 9
  • Karma: 1
Wow, you are fast! :)

That was it...
The Amazing Spider-Man V1963 #650 (2011).cbz

Removing the (2011) it works perfect.

Is there a line I can comment out so that it doesn't skip names with parenthesis? I tried to remove "and !($file =~ /\(/)" but it messed up some of the renaming.

Thanks,
flips
The administrator has disabled public write access.

Re: malor89's Perl Scripts 6 years 6 months ago #12983

  • malor89
  • malor89's Avatar
  • Offline
  • Senior Boarder
  • Posts: 73
  • Thank you received: 16
  • Karma: 17
flips wrote:
Is there a line I can comment out so that it doesn't skip names with parenthesis? I tried to remove "and !($file =~ /\(/)" but it messed up some of the renaming.
One of the reasons the check for parentheses is there, is to prevent it from messing up good file names. Your change is on the right track, but you may be able to get closer to the result you want by:
Replace:	if($restorefilename and $file =~ /\.(cb[rz]$)/i and !($file =~ /\(/)) {
With:		if($restorefilename and $file =~ /\.(cb[rz]$)/i and !($file =~ /(\(.*){2}/)) {
You can modify the number {2} to specify the desired minimum number of ()’s. So this would still try to change a filename with just the year, but not a filename with a full set of tags.
Last Edit: 6 years 6 months ago by malor89.
The administrator has disabled public write access.

Re: malor89's Perl Scripts 6 years 6 months ago #13335

  • Kerviel
  • Kerviel's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 17
  • Karma: 0
malor89 wrote:
flips wrote:
Is there a line I can comment out so that it doesn't skip names with parenthesis? I tried to remove "and !($file =~ /\(/)" but it messed up some of the renaming.
One of the reasons the check for parentheses is there, is to prevent it from messing up good file names. Your change is on the right track, but you may be able to get closer to the result you want by:
Replace:	if($restorefilename and $file =~ /\.(cb[rz]$)/i and !($file =~ /\(/)) {
With:		if($restorefilename and $file =~ /\.(cb[rz]$)/i and !($file =~ /(\(.*){2}/)) {
You can modify the number {2} to specify the desired minimum number of ()’s. So this would still try to change a filename with just the year, but not a filename with a full set of tags.

Can I make this same sort of code change for the comicsort.pl?

I came here looking for a solution to a problem I was having with the comicsort script as it seems to skip all my files when I try and use this script. I am thinking it is because I too use the year in (xxxx) format in all of my file names. It doesn't seem to want to sort anything with (year) in the filename.
The administrator has disabled public write access.

Re: malor89's Perl Scripts 6 years 6 months ago #13336

  • Der Internet
  • Der Internet's Avatar
  • Offline
  • Gold Boarder
  • Posts: 176
  • Thank you received: 5
  • Karma: 1
since 138 the "next issue to read" script doesnt work for me anymore...

edit: after a reboot and selecting the user script in the autoplaylist it works just fine again :)
Last Edit: 6 years 6 months ago by Der Internet.
The administrator has disabled public write access.

Re: malor89's Perl Scripts 6 years 6 months ago #13344

  • malor89
  • malor89's Avatar
  • Offline
  • Senior Boarder
  • Posts: 73
  • Thank you received: 16
  • Karma: 17
Kerviel wrote:
Can I make this same sort of code change for the comicsort.pl?

I came here looking for a solution to a problem I was having with the comicsort script as it seems to skip all my files when I try and use this script. I am thinking it is because I too use the year in (xxxx) format in all of my file names. It doesn't seem to want to sort anything with (year) in the filename.
comicsort.pl ignores anything in parentheses, so that shouldn't cause a problem in the comic archive name. However, the directory names for each series needs to be simple (no years, volumes, etc.) Make sure that "$comicdir = "..";" is set correctly in the script as well. If you give me a sample comic name and sample directory name, I would have a more specific explanation.

The listsort.pl/makesort.pl combination is a lot more robust sorting script and has replaced my use of comicsort.pl. It can sort to subdirectories, combine multiple related titles in a single directory, and more.
Last Edit: 6 years 6 months ago by malor89.
The administrator has disabled public write access.

Re: malor89's Perl Scripts 6 years 6 months ago #13345

  • Kerviel
  • Kerviel's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 17
  • Karma: 0
I am planning on using the makesort and listsort scripts after I get my initial organization complete. I am following 600WPM's guide to organizing it all to start with.

Here is an image to show you what I did.

I used the makedirs to create folders based on the files in the folder, which it created as you can see, then I clicked on comicsort and all it does it try and move them all to \misc. I had a misc folder in there at one point and it still did nothing, it didn't even try and move them there.
Last Edit: 6 years 6 months ago by Kerviel.
The administrator has disabled public write access.

Re: malor89's Perl Scripts 6 years 6 months ago #13349

  • malor89
  • malor89's Avatar
  • Offline
  • Senior Boarder
  • Posts: 73
  • Thank you received: 16
  • Karma: 17
You need to either put all your unsorted comics into a new directory called for example "unsorted" and run the comicsort.pl script from there or you can edit comicsort.pl and set $comicdir = ".";

By default it tries to sort comics into the folders in the parent directory of the folder comicsort.pl is run, so it ignores all the folder in the current directory.
The administrator has disabled public write access.

Re: malor89's Perl Scripts 6 years 6 months ago #13352

  • Kerviel
  • Kerviel's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 17
  • Karma: 0
Ok, I now understand what I was doing wrong after your last explanation. 600WPM is probably going to need to adjust his guide a little bit as it directs the person to move the comics to their respective publisher folders and then to run makedirs in each publisher folder and then to run comicsort to match the comic name and move them accordingly.

Perhaps that is how it worked with an older version of the comicsort.pl script.
The administrator has disabled public write access.

Re: malor89's Perl Scripts 6 years 3 months ago #15616

  • ChapeL
  • ChapeL's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 16
  • Thank you received: 1
  • Karma: 0
More I look into it more brilliant scripts I find :) I'm loving fixnames.pl, saves sooo much time :)

One question though, is there a way to accept all to change without asking? For now I need to press Enter for every single file and script does such brilliant job that I dont need to see if every file is named correctly.

Thanks
ChapeL
The administrator has disabled public write access.

Re: malor89's Perl Scripts 6 years 3 months ago #15617

  • 600WPMPO
  • 600WPMPO's Avatar
  • Offline
  • Moderator
  • Posts: 3788
  • Thank you received: 557
  • Karma: 232
ChapeL wrote:
...is there a way to accept all to change without asking? For now I need to press Enter for every single file and script does such brilliant job that I dont need to see if every file is named correctly..
Open the fixnames.pl script with a text editor (I use Notepad++). Change the value of prompt to "0".

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: ChapeL
Time to create page: 0.424 seconds

Who's Online

We have 204 guests and 7 members online