comictagger / gcd_talker

A Grand Comics Database talker for Comictagger
Apache License 2.0
2 stars 1 forks source link

Imprints #13

Closed Vertigooo2 closed 2 weeks ago

Vertigooo2 commented 2 months ago

GCD does not have a specific table for imprints, but it does have one that can be used to obtain the same information: gcd_brand_group. An issue's imprint can be obtained through gcd_issue > gdc_brand > gcd_brand_emblem_group > gcd_brand_group. An example:

select gcd_issue.id, gcd_brand_group.name
from gcd_issue
LEFT JOIN gcd_brand ON gcd_issue.brand_id=gcd_brand.id
LEFT JOIN gcd_brand_emblem_group ON gcd_brand.id=gcd_brand_emblem_group.brand_id
LEFT JOIN gcd_brand_group ON gcd_brand_emblem_group.brandgroup_id=gcd_brand_group.id
LEFT JOIN gcd_series ON gcd_issue.series_id=gcd_series.id
LEFT JOIN gcd_publisher ON gcd_series.publisher_id=gcd_publisher.id
WHERE gcd_publisher.id = 54
and gcd_publisher.name is not gcd_brand_group.name
and gcd_brand_group.name is not NULL

I am attaching the modified gcd.py file in case it can help you in any way:

gcd.py.zip

I have made modifications to: GCDIssue _format_gcd_issue _fetch_issue_by_issue_id _map_comic_issue_to_metadata

mizaki commented 2 months ago

Thanks, I'll take a look. Without a schema and trying to dig through the GCD code I'm sure there are lots of improvements that can be made, so any are welcome. I need to get some tests running first to check things won't break though.

mizaki commented 1 month ago

I've implemented it in #16 does the option to use the imprint as the publisher make sense?

Vertigooo2 commented 3 weeks ago

About that option, I don't know if it will be useful to anyone. I prefer to have the publisher and the imprint in different fields.

I have tested your code and it works correctly. However, I have seen a bug. It is possible for a issue to have several imprints, for example:

https://www.comics.org/issue/127402/

This issue has two imprints: Elseworlds and Wildstorm. In the current select it only detects one. This line would have to be changed:

"(select gcd_brand_group.name "

to:

"(select group_concat(gcd_brand_group.name,'; ') "

mizaki commented 2 weeks ago

Addressed in #16