gotson / komga

Media server for comics/mangas/BDs/magazines/eBooks with API, OPDS and Kobo Sync support
https://komga.org
MIT License
3.93k stars 234 forks source link

use `year` when importing `.cbl` for matching #776

Closed MKH-42 closed 1 year ago

MKH-42 commented 2 years ago

Komga environment

Describe the bug

When I have 2 series with the same series name and the same volume but with different years of the comic and I create a cbl file with ComicRack Komga can not find this comics. The reason looks like that Komga ignore the year tag.

Steps to reproduce

  1. extract the sample in a folder and add this folder to komga.
  2. Go to Import.
  3. Click on Import Reading Lists
  4. Select the reading list with same series name, number, volume number but different years.
  5. Import the list
  6. see the errors

Expected behavior

I expect that when series name, number, volume and year are different than komga should find the right file.

Actual behavior

No unique match for series.

Additional context

Add any other context about the problem here.

Screenshots

see attachment grafik

Log file

If applicable, add an excerpt of the log file (max 20 lines) AND attach the complete log file or a link to a gist/pastebin containing the log file (where to find the logs).

I add also a zip file to reproduce it on this report. CBL Test.zip

gotson commented 2 years ago

Do you have a real example where that happened?

MKH-42 commented 2 years ago

here are 2 examples for a batman series with volume 1997: https://www.comicguide.de/book/63507/Batman-1 https://www.comicguide.de/series/4827/Batman-%28Heft%2C-Dino%29 Batman - both Volume 1997 - Number 6 - Dino with story Underworld (year 1997), ehapa no story line at number 6 (1998). This happens with bigger series when they are published in other countries which are different than the producer land. The countries creates own series names and volume numbers.

gotson commented 2 years ago

Something i don't understand, you write:

I expect that when series name, number, volume and year are different than komga should find the right file.

But both series in your real life example have the same volume (1997), so they also have the same year (1997).

It would work if the year attribute referenced the year of the book, not of the series, but that is something i cannot confirm, because the cbl XML schema is undocumented.

MKH-42 commented 2 years ago

Thank you for investing time on this topic.

What is the problem, when you have 3 information: series name, volume name, year to use all 3 parameters for finding the right comic? the 3 paramters are available - so why not using them? When you say, this problem is not so often because it is only a country problem and you don't want to fix this - thats also fine. But I find out a gap and tried to find a solution to make komga fantastic :-)

yes, cbl xml schema is not documented .. but when I use comicrack it creates always this 3 information when it is available for this comic in comirack: series name, volume and year. I am using ComicRack v0.9.178.

gotson commented 2 years ago

What is the problem, when you have 3 information: series name, volume name, year to use all 3 parameters for finding the right comic? the 3 paramters are available - so why not using them?

It's a feature request, so it's not been done before.

When you say, this problem is not so often because it is only a country problem and you don't want to fix this - thats also fine.

I never said I don't want to fix it. I asked for real life example because made up examples are not representative.

yes, cbl xml schema is not documented .. but when I use comicrack it creates always this 3 information when it is available for this comic in comirack: series name, volume and year. I am using ComicRack v0.9.178.

Is it using the year of the series or the year of the book for that field?

I was not aware how you built those files (you didn't explain), and since I have never used ComicRack, I cannot confirm whether the year is the year of the book or the series. If you are able to confirm that point that would help, else I cannot work on this.

ackbarr commented 2 years ago

In Comicrack, the year property is the release year of the book. Volume (if using the ComicVine API scraper plugin) is the year of the first issue Screenshot 2022-01-17 172306 .

gotson commented 2 years ago

In Comicrack, the year property is the release year of the book. Volume (if using the ComicVine API scraper plugin) is the year of the first issue Screenshot 2022-01-17 172306 .

What does the xml look like if the book has no year?

ackbarr commented 2 years ago

Here's an example ComicRack generated comicinfo.xml when the publish date is blank

ComicInfo - After Removal of Publish Date.txt

gotson commented 2 years ago

Here's an example ComicRack generated comicinfo.xml when the publish date is blank

ComicInfo - After Removal of Publish Date.txt

I'm interested in the cbl, not the comicinfo.xml 😅

ackbarr commented 2 years ago

Sorry for the confusion, here is an example Reading List, the first book without a publishdate, the second one with. List Test with Year and without.txt

jakem742 commented 2 years ago

This would be extremely helpful :)

It looks like this is a matter of:

  1. Adding 'val year: String' - ReadListRequest.kt ln 14
  2. Use 'seriesRepository.findAll(book.series + " " + book.year)' - ReadListMatcher.kt line 37

The cbl parser would also need to be updated to extract the year and pass it to the ReadListMatcher, but don't know where that's all handled.

flips22 commented 2 years ago

I'm also seeing this quite a bit. For what I have seen it is when there is a TPB released in the same year as a limited series. Usually the TPB is a year later, so it isn't an issue, but sometimes it does happen in the same year. Unfortunately, the proposed fix will only address the issue if the published year is different for book 1 and the TPB. The series Dark Reign Made Men, has this issue, but the years and volumes are all the same.

I don't know what the options are. In theory you could use the format tag. My books aren't properly tagged, and it should say TPB instead of limited series, for the first one but I don't think that is a tag that comicvine populates, so I don't think it will be much use. Perhaps mylar could add the tag based on a ruleset, but not sure.

Or we move away from the existing CBL list format and create something else using CV series identifier, perhaps.. and then use some other app to create the list, not sure. For me the fix is to delete the TPB and just reference the limited series.

`<?xml version="1.0"?>

made men test 0af4a6d5-1bf8-48a7-a656-bb8e6fc2bf3c 2ddfa631-2095-4619-ab34-86384c0dc607 051b99c1-c2e8-41b1-85f9-ae43c31a4f46 e96b3747-8f04-49cd-acce-fdfa1f22dead 45682c24-2109-4ea8-b4cb-b928be6c5c43 31744396-2ba8-46fb-a4e7-46db6f5e5a87 `
gotson commented 1 year ago

I started looking at this, but after reading the history it seems there is some confusion.

The Year attribute in the .cbl file is the book's release year. It has nothing to do with the series.

The first post is about not finding the right series.

If we use the book's year, it can only be used to locate the book, it cannot help to locate the series, thus that would not issue.

It could be used to find the right book when there are more than 1 matches, but that's not what the original issue is about.

themadman0980 commented 1 year ago

Yep, I think I added my suggestion above to the wrong issue on Github, apologies. It probably belongs with #1009.

Is Komga currently using the Volume field correctly when importing series? I think my comment above was based around the fact that only the series title is checked currently. The idea was that a year field should be added to the series object so this series year can be stored from the Volume tag.

The only problem with this is when the volume field contains an actual volume number and not a year. :/ I guess you should be able to process whether the entry is a year or volume number using regex and assign them to different properties, but not sure what the implications of this are.

Basically, if more than one series title match is found, Komga doesn't know what to do? I may be reading ReadListMatcher.kt wrong here though.

gotson commented 1 year ago

Is Komga currently using the Volume field correctly when importing series? I think my comment above was based around the fact that only the series title is checked currently.

Yes. Komga doesn't have a volume field, but the volume is added in brackets in the series title when importing from Comicinfo.xml, the same logic is used when matching series via a .cbl file.

Basically, if more than one series title match is found, Komga doesn't know what to do? I may be reading ReadListMatcher.kt wrong here though.

Yes, because the readlist import is a one shot operation of request/macthing. I have plans to change it to a 2-step operation, which will allow for interactive import and corrective actions in the UI, a bit how the book import feature works.

That should solve all those problems.

gotson commented 1 year ago

Closing this as the latest release has interactive import of cbl files.