Kareadita / Kavita

Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.
http://www.kavitareader.com
GNU General Public License v3.0
5.92k stars 307 forks source link

Manga filename parser ignores first volume indicator when multiple are present (as sub-title) #1336

Open ocgineer opened 2 years ago

ocgineer commented 2 years ago

I have a few series that are condensed together to the same series name, using volumes in order where after the volume indicator is a sub-title that also include a volume, in case the sub-title contains multiple volumes or parts. The filename parser ignores the first volume indicator and instead uses the one in the sub-title.

The expected behavior would be that the very first volume indicator is used, and anything after that is ignored as part of the series keeping everything in-line to get them collected under one series properly.

Few example filenames;

Ascendance of a Bookworm v01 - Part 01 v01 (2019) (Digital) (danke-Empire)
Ascendance of a Bookworm v02 - Part 01 v02 (2019) (Digital) (danke-Empire)
...
Ascendance of a Bookworm v07 - Part 01 v07 (2021) (Digital) (danke-Empire)
Ascendance of a Bookworm v08 - Part 02 v01 (2021) (Digital) (Edge)
Ascendance of a Bookworm v09 - Part 02 v02 (2021) (Digital) (Edge)
Pokémon Adventures v01 - Red & Blue v01 (AnHeroGold-Empire)
Pokémon Adventures v02 - Red & Blue v02 (AnHeroGold-Empire)
...
Pokémon Adventures v04 - Yellow v01 (AnHeroGold-Empire)
Pokémon Adventures v05 - Yellow v02 (AnHeroGold-Empire)
...
Pokémon Adventures v08 - Gold, Silver & Crystal v01 (AnHeroGold-Empire)
The Space Pirate COBRA v01 - The Psychogun Vol.1 [MDKM] (Creek & River)
The Space Pirate COBRA v02 - The Psychogun Vol.2 [MDKM] (Creek & River)
The Space Pirate COBRA v03 - Legend of Mandrad [MDKM] (Creek & River)
...
The Space Pirate COBRA v10 - Golden Gate [MDKM] (Creek & River)
The Space Pirate COBRA v11 - Magic Doll Vol.1 [MDKM] (Creek & River)
The Space Pirate COBRA v12 - Magic Doll Vol.2 [MDKM] (Creek & River)

image

Desktop (please complete the following information):

Additional; If the first volume indicator would be used, this then could also be properly be used to group other series together under an "umbrella" series name in the right order. For example, JoJo and Higurashi that span multiple series but could be collected under one for ease of access and proper ordering without the need for comic info.

majora2007 commented 2 years ago

I have seen this issue occur with the parser, I know exactly where it happens. I don't know if I'll be able to support it, but will give it a go.

For your additional, I will say, for things like reading order, you are better off using series relationships to wire them up in Kavita. It's a much better experience.

tjarls commented 2 years ago

One quick fix here is to rename the files so that the first volume uses either vol. or volume as a prefix instead of just the letter v For example this would get parsed as expected:

Ascendance of a Bookworm vol.01 - Part 01 v01 (2019) (Digital) (danke-Empire)

That is not to say that this is not an issue. The current parser is far too inconsistent. In this example vol. and volume appear in a non greedy regex while volumes prefixed with just v do not. As a result, the rules of the filename parser are far too arcane for be described in detail in a way that would help users.

ocgineer commented 2 years ago

Hmm interesting, will have a look and use that for now if that does the trick. On the other hand I could've also just left out the sub-title part, but I like to keep the filenames as intact as possible, hench the report.

I would like to keep using the (somewhat) "standardized" naming convention for Manga that is distributed online and that is used v. The use of Vol. is mostly used in sub-title (though the examples I gave don't) and if they are used as primary marker then this is from new ripper/uploader or it is a very old upload, of all the manga I currently have from online sources, I have very rarely seen Vol. being used (and usually there is a better/newer upload available of that book).

ocgineer commented 2 years ago

I just did a test Vol. 01 (with a space, which looks nicer imo) didn't work and acted the same as v01.

Using Vol.01 does seem to group the books into the same series but the actual displayed volumes are wrong. edit: and it only shows those 7 books, out of the 14 that are in the series. this is on latest NIGHTLY.

image

with the following books

Pokémon Adventures Vol.01 - Red & Blue v01 (AnHeroGold-Empire)
Pokémon Adventures Vol.02 - Red & Blue v02 (AnHeroGold-Empire)
Pokémon Adventures Vol.03 - Red & Blue v03 (AnHeroGold-Empire)
Pokémon Adventures Vol.04 - Yellow v01 (AnHeroGold-Empire)
Pokémon Adventures Vol.05 - Yellow v02 (AnHeroGold-Empire)
Pokémon Adventures Vol.06 - Yellow v03 (AnHeroGold-Empire)
Pokémon Adventures Vol.07 - Yellow v04 (AnHeroGold-Empire)
Pokémon Adventures Vol.08 - Gold, Silver & Crystal v01 (AnHeroGold-Empire)
Pokémon Adventures Vol.09 - Gold, Silver & Crystal v02 (AnHeroGold-Empire)
Pokémon Adventures Vol.10 - Gold, Silver & Crystal v03 (AnHeroGold-Empire)
Pokémon Adventures Vol.11 - Gold, Silver & Crystal v04 (AnHeroGold-Empire)
Pokémon Adventures Vol.12 - Gold, Silver & Crystal v05 (AnHeroGold-Empire)
Pokémon Adventures Vol.13 - Gold, Silver & Crystal v06 (AnHeroGold-Empire)
Pokémon Adventures Vol.14 - Gold, Silver & Crystal v07 (AnHeroGold-Empire)
Roshri commented 2 years ago

I had a similar issue with Pokemon Adventures. For now the only workaround I found was removing v from the sub-title and now it shows the 57 volumes in a single series

image

ocgineer commented 2 years ago

Something else I found, while checking/testing for unwanted chapters. (also mentioned in 1534)

Path of the Assassin v09 - Battle for Power Part 1 (2008) (Digital) (Lovag-Empire).cbz
Path of the Assassin v10 - Battle for Power Part 2 (2008) (Digital) (Lovag-Empire).cbz

Show up as volume 9 and 10 but also as chapter 1 and 2.