Welcome, Guest
Python Scripts for ComicRack

TOPIC: [Script] First X in each Y - Smartlist Script (NEW 0.6 Beta!)

[Script] First X in each Y - Smartlist Script (NEW 0.6 Beta!) 11 months 3 weeks ago #48300

  • Xelloss
  • Xelloss's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 596
  • Thank you received: 150
  • Karma: 30
I was totally sure I have uploaded this script to the forum, but as I haven't find it anywhere I will create a new topic (if I have post it before, please tell me)

This script is another script I made some time ago to deal with comics inside stacks or groups (the other one being the new "Expand by" script I recently posted)

This one is more centered in quantities and sorting.

The idea of this script are for this kind of situations:

Example1: I want the last comic of each Volume
Example2: I want the first 2 comics of the year
Example3: I want tto now the last number of many Series
Example4: I want to know which series has more than 10 comics

For this I created this tool.

What it does is simple, it first group comics by Y attribute/s (all comics that, for example Series and Volume are the same)
Once the groups are made, they are ordered by X attribute/s (for example by number)
Finally it count the first or last n comics of each group, according to the sorting

For example: "First Number in each Series"

How to use the script:

In X put the attribute or attributes by which you want to order them (number, title, date, etc)
- You can use "|" for more than one criteria, for example Year!Month will sort first by Year, and inside each Year by month
- You can put "-" right before the name of the attribute for inverse sorting, turning First comcs into Last comics
- You can put "+" symbols before the attribute to add one comic more (first is default , ++ is first 2, +++ is first 3, etc)
- You can put "." symbols before the attribute to add an ignore comic to the added ones (+.+ is for example the first and third, not the second)
- You can combine the above attributes in any order you want, but "+" s and "."s are before the "-"

In Y put the attribute or attributes by which you want to separate the comics (Series, Volume, Year, etc)
- You can use "|" for more than one criteria (for example for volumes of a series use Series|Volume)
- You can use "!" before the attribute to make the comparision made into "similar" instead of "equal"

Examples:

1- You want first number of each volumes

X = Number
Y = Series|Volume

2- You want last published comic of each series

X= -Year|Month|Day
Y= Series

3- You want first two numbers of each year

X= ++Number
Y= Year

4- You want first and third number of each Series Group in each Imprint

X= +.+Number
Y= SeriesGroup|Imprint

5- You want the last and the 2 number before that of each comic with similar Imprint (ignore Capitals for example)

X= +.+-Number
Y= !Imprint

6- You want to know which Volumes reaches 10 comics

X= .........+Number
Y= Series|Volume

note: You can then use "Expand by" script to show complete volumes instead of only the tenth comic

and you get the idea XD

V0.6 Beta

File Attachment:

File Name: FirstXinEa...crplugin
File Size:4 KB


Versions:


0.1 First version, it seems to work :)
0.2 A lot of changes of how the script works, fixed cases in which X and Y are empty, added up to 4 posible ordering values, added Number as default secondary Xs, now you can add +s with no X, many bugs fixed, performance improved
0.3 Added "-" symbol for changing from "first" values to "last" values and virtually infinite posible ordering values
0.4 Fixed order in values starting with numbers
0.5 Added "." symbol to "jump" values
Last Edit: 7 months 4 weeks ago by Xelloss.
The administrator has disabled public write access.

[Script] First X in each Y - Smartlist Script (Ver 0.5 Beta) 7 months 4 weeks ago #49222

  • Xelloss
  • Xelloss's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 596
  • Thank you received: 150
  • Karma: 30
Big update:


Seeing how Duplicate Manager scrpt works, I decided to add its rules sintaxis into this script as an option...

As both scripts part from the same idea (you group things by x reason, and then applied a y criteria to choose which one to pick from every group), I thought it could be a good way to apply the great rules this perezmu script has, but inside a smartlist format...

First of all, this is a VERY EARLY release, with a few of the syntaxis words applied (more to be added in the following days) and a LOT of debugging to do. Keep that in mind while testing it... My idea is, in the end, trying to emulate every rule you use in that script in this one as a smartlist... BUT THERE IS A LONG WAY TO THAT POINT YET!

How to test this:

The symbol for Duplicate Manager sintaxis is "@", you put that, and space, and a rule (only ONE rule for rule in the smartlst)

For example (using First X in Each Y smartlist rule):

A = @ filesize keep smallest
B = comicvine_issue (here you put the rule to detect duplicates, for example "comicvine_issue" or "Series|Volume|Format")


This will filter comics similar to what rule "filesize keep smallest " do in Duplicate Manager

To put more rules, just add another rule to the smartlist and complete again A (The new rule) and B (the same B). Order of rules is important, as in the original script.

You can of course combine these rules with normal smartlist rules.

Once you finish adding all the rules, the comics showed in the smartlist will be the ones that the same rules would KEEP in the Duplicate Manager (if you want the ones the script would delete, just negate all rules in the smartlist)

IMPORTANT: This is for manually deleting the comics, of coruse, and not automatically moved to a folder as the original script. But it will show you the results of the rules in a smartlist, so that you can delete them easily or do whatever you want.

What I have already added to the syntaxis:

Text search related rules (with all the options from the wiki)
Filesize related rules (with all the options from the wiki)
Pagecount related rules (with all the options from the wiki)
Other rules (with all the options from the wiki)

To do list:

Pagesize related rules
Alternate covers related rules

I EMULATE ALL THE RULES BY THE WIKI DESCRIPTION AND NOT BY HOW THE DUPLICATE MANAGER WORKS, SO THERE WILL BE MANY DIFFERENCES IN THE RESULTS (I THINK). THE IDEA IS TO FIX THOSE DIFFERENCES AND THAT THEY WORK AS THEY DO IN THE DUPLICATE MANAGER.

A LOT of bug fixing :P

LINK OF THE NEW VERSION IN THE FIRST POST (updated)

Note: You can use the script as always just not puting the @ symbol in the A field :P

FOR MORE INFORMATION ABOUT THE GREAT SCRIPT I AM TALKING ABOUT (from @Perezmu) VISIT HIS SITE

code.google.com/archive/p/comicrack-duplicates-manager/
Last Edit: 7 months 4 weeks ago by Xelloss.
The administrator has disabled public write access.
The following user(s) said Thank You: perezmu

[Script] First X in each Y - Smartlist Script (Ver 0.5 Beta) 7 months 3 weeks ago #49277

  • perezmu
  • perezmu's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1135
  • Thank you received: 64
  • Karma: 51
I appreciate the praise to the script, Duplicates Manager. It is true that I did start it, conceived it and made a first working version... but the fine version we all use was developed by Ricardo (PESCUMA)... I do not have such skills ;) .... So praise to him too! :)

Thanks for your contributions, also... it is great to have someone actively developing new stuff here!
The administrator has disabled public write access.
Time to create page: 0.624 seconds

Who's Online

We have 127 guests and 2 members online