Welcome, Guest
Python Scripts for ComicRack

TOPIC: [MOD] Import tags from filename with regular expressions

[MOD] Import tags from filename with regular expressions 2 years 3 weeks ago #43830

  • jkthemac
  • jkthemac's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 766
  • Thank you received: 253
  • Karma: 55
But cYo already made me happy by implementing SQL so I can leave the database handling to my NAS. That stopped me worrying about metadata. I think one issue is that no one really owns the CBZ / CBR as a standard (as far as I know) so messing with the format would only lead to potential problems with other applications.
The administrator has disabled public write access.

[MOD] Import tags from filename with regular expressions 2 years 3 weeks ago #43831

  • freMea
  • freMea's Avatar
  • Offline
  • Junior Boarder
  • Posts: 38
  • Thank you received: 5
  • Karma: 1
The idea is not replacing any remote or local database but simply complete the existent feature that make a copy of data into comics file itself. It would make backup/restore painless in worst case scenario where database is corrupted or lost with no backup, from basic to advanced users. While the file exist, its data exist and can move with it. What can be more consistent?

But if you don't wish to support this feature, I respect it.
Last Edit: 2 years 3 weeks ago by freMea.
The administrator has disabled public write access.

[MOD] Import tags from filename with regular expressions 2 years 3 weeks ago #43832

  • jkthemac
  • jkthemac's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 766
  • Thank you received: 253
  • Karma: 55
He He.
I have been here long enough to express my views on expanding the XML file. I also know what is likely to be worked on and what isn't. There is a reasonable backup script for those that dont use SQL and SQL implementations support backups.

I would love to see an expansion of the XML standard to allow for everything, including a custom area, but I dont expect it to happen and there are other things I would like to see that take priority, like a proper SQL database as opposed to the one we have now. One that can be interrogated by other database programs or client software.

Anyway, I am beginning to worry we are clogging up a thread about a script with other issues. If you ever take any of these regex apps further I will be willing to test them to destruction because I like playing with regex.
Last Edit: 2 years 3 weeks ago by jkthemac.
The administrator has disabled public write access.

[MOD] Import tags from filename with regular expressions 1 year 11 months ago #44194

  • misakitchi
  • misakitchi's Avatar
  • Offline
  • Senior Boarder
  • Posts: 43
  • Karma: -1
Hi!
Thanks for your hard work! :)

Can you add support of "Scan Information" and "Series Group" ?

Thanks! ^_^


Note: Bedetheque Scraper 2 v4.6 Beta is OUT! ;o)
Last Edit: 1 year 11 months ago by misakitchi.
The administrator has disabled public write access.

[MOD] Import tags from filename with regular expressions 1 year 11 months ago #44198

  • freMea
  • freMea's Avatar
  • Offline
  • Junior Boarder
  • Posts: 38
  • Thank you received: 5
  • Karma: 1
misakitchi wrote:
Can you add support of "Scan Information" and "Series Group" ?
Did you try Priat? It may have this feature.
The administrator has disabled public write access.

[MOD] Import tags from filename with regular expressions 1 year 11 months ago #44203

  • misakitchi
  • misakitchi's Avatar
  • Offline
  • Senior Boarder
  • Posts: 43
  • Karma: -1
I try PRIAT but its bugging with my regular expression, don't know why...
My regular expression is working with your plugin
I use Expresso to test my regular expression
The administrator has disabled public write access.

[MOD] Import tags from filename with regular expressions 1 year 11 months ago #44205

  • freMea
  • freMea's Avatar
  • Offline
  • Junior Boarder
  • Posts: 38
  • Thank you received: 5
  • Karma: 1
misakitchi wrote:
I try PRIAT but its bugging with my regular expression, don't know why...
Did you ask for help in PRIAT topic, posting your regex and example path?
The administrator has disabled public write access.

[MOD] Import tags from filename with regular expressions 1 year 11 months ago #44206

  • misakitchi
  • misakitchi's Avatar
  • Offline
  • Senior Boarder
  • Posts: 43
  • Karma: -1
When PRIAT have no info it put a "?" and its really annoying! :(

The plugin from Yellowbox and your leave blank if no info, its better

But PRIAT is working with ScanInfo

Here my regex:

.*\\\[((?<AlternateSeries>\w+\s\w+)(\]\s))(?<Series>(.*?)?)((\s-\s((T(?<Number>\d+).*)|((?<Number>MR(\d+)?).*)))|(\s-\s(?<AlternateNumber>(HS|H\d+|INT|PUB|R\d+|C\d+)(\d+)?).*)|(\s-\s(\@(?<AlternateNumber>.*?)(\s-\s).*))|(\s-\s(?<Editor>(One Shot|Bonus|PACK|Virtualis|Portfolio)).*)|(\s-\s(ID(?<ScanInformation>\d+).*)))

Its for french BD/comics
Example:
[BD FR] serie - T02 - Title [1920].zip
[BD FR] serie - HS3 - Title [1920].zip


PS1: when i use my regex i have an error with your plugin, but not with yellowbox version. I think its because of "ScanInformation"
yellowbox version just leave blank "ScanInfo"

PS2: can you change the icon/image of your plugin? because its the same as PRIAT...

PS3: can you add an option to "Always skip" when error, because i must always clic on "OK" button...
Last Edit: 1 year 11 months ago by misakitchi.
The administrator has disabled public write access.

[MOD] Import tags from filename with regular expressions 1 year 11 months ago #44208

  • jkthemac
  • jkthemac's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 766
  • Thank you received: 253
  • Karma: 55
The regex should return an error, you are trying to use

((T(?<Number>\d+).*)|((?<Number>MR(\d+)?).*))

Which is technically defining Number in more than one way in the same expression. That may be possible in some implementations, but if it is I am not familiar with that. You can use the same group name twice but not both at the same time.

Also, unless I am missing something what is the MR matching? Is it your intention that 'MR02' be a valid Number?

Also you appear to be trying the same trick with AlternateNumber.

---
In general I would recommend rewriting such that the logical OR is inside the capture group rather than define the capture group on each side of the OR. It would certainly be more likely to work across regex implementations.

For example

T?(?<Number>(\d+).*|MR(\d+)?).*

is functionally similar to

((T(?<Number>\d+).*)|((?<Number>MR(\d+)?).*))

although I cant help thinking you actually want

T?(MR)?(?<Number>\d+).*

which would match
01
T01
MR01

all as 01

Or Perhaps

(T|MR)(?<Number>\d+).*

Which would only match the number if followed by T or MR
Last Edit: 1 year 11 months ago by jkthemac.
The administrator has disabled public write access.

[MOD] Import tags from filename with regular expressions 1 year 11 months ago #44209

  • misakitchi
  • misakitchi's Avatar
  • Offline
  • Senior Boarder
  • Posts: 43
  • Karma: -1
Thanks for your response :)
My regex IS working!

I just say that with PRIAT, i have "?" when no info
But i will ask on PRIAT post for help, i think its better

I change my regex: MR to AltNumber

.*\\\[((?<AlternateSeries>\w+\s\w+)(\]\s))(?<Series>(.*?)?)((\s-\s(T(?<Number>\d+).*))|(\s-\s(?<AlternateNumber>(HS|H\d+|INT|PUB|R\d+|C\d+|MR\d+)(\d+)?).*)|(\s-\s(\@(?<AlternateNumber>.*?)(\s-\s).*))|(\s-\s(?<Editor>(One Shot|Bonus|PACK|Virtualis|Portfolio)).*)|(\s-\s(ID(?<ScanInformation>\d+).*)))

T= Tome (Volume in english i think)
MR= Mini Récit

Check this page:
www.bedetheque.com/serie-8363-BD-Flagada.html

[BD FR] Le Flagada - T01 - Emilius le Terrible (Degotte).zip
=> Series = Le Flagada // Number = 01
[BD FR] Le Flagada - MR01 - Prenez garde au Flagada! (Degotte).zip
=> Series = Le Flagada // AlternateNumber = MR01

My regex is working, i just have an error with the new version of fremea, because i add <ScanInformation> and its not supported
But its weird because with the "old" version of Yellowbox i have no error: <ScanInformation> is blank, but no error

And very important: to Yellowbox or Fremea
Can you add an option to "Always skip" when error, because i must always clic on "OK" button...
Last Edit: 1 year 11 months ago by misakitchi.
The administrator has disabled public write access.
Time to create page: 0.312 seconds

Who's Online

We have 234 guests and 3 members online