Skip to content

Add Series EndYear, Status & Summary elements to v1.2 draft - #91

Merged
bpepple merged 5 commits into
Metron-Project:masterfrom
ajslater:series-end-year-status-summary
Oct 27, 2026
Merged

bpepple merged 5 commits into
Metron-Project:masterfrom
ajslater:series-end-year-status-summary

Conversation

@ajslater

@ajslater ajslater commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

I have no idea if this fits with any of your ideas about MetronInfo. Just a suggestion.

Adds three optional elements to <Series> so a series' end year, publication status and description can travel in MetronInfo.xml. Metron's series API already exposes all three (year_end, status, desc), and comicbox and Codex already read them from it, but no comic metadata file format can hold them today.

<Series id="65478" lang="en">
    <Name>Justice League</Name>
    ...
    <StartYear>1970</StartYear>
    <EndYear>1975</EndYear>
    <Status>Completed</Status>
    ...
    <Summary>The World's Greatest Super-Heroes unite to ...</Summary>
</Series>

Depends on #90

#90 starts the drafts/v1.2 schema, and this PR adds to that draft. The branch is stacked on #90's commit, so until #90 merges, this PR's diff includes it. The change in this PR is the last commit only (4afbd50). I'll rebase onto master once #90 is in.

The elements

All three are minOccurs="0". seriesType is an xs:all, so their order isn't enforced. They sit where a reader would look for them.

Element Type Placement Metron API field
EndYear xs:gYear right after StartYear year_end
Status seriesStatusType (new enum) after EndYear status
Summary xs:string last, after AlternativeNames (long text) desc

EndYear uses StartYear's type, xs:gYear, so the two are always read and validated the same way. I didn't add an EndYear >= StartYear assertion: XPath 2.0 doesn't define lt/ge on xs:gYear, so the assertion would have to cast the values as strings. That seemed better left to writers.

Status is a closed enumeration: Cancelled, Completed, Hiatus, Ongoing. These are exactly the Series.Status labels in comicsdb/models/series.py, which the API returns via get_status_display. The values are listed alphabetically, as formatType's are. The type is named seriesStatusType instead of statusType, so a future issue-level status won't collide with it. There is no default: if the element is absent, the status is unknown. Assuming Ongoing, which is Metron's database default, would be wrong for files tagged from other sources.

Summary (not Description or Desc): MetronInfo names elements after what they mean, not after Metron's API field names (StartYear rather than year_began, AlternativeNames rather than alt_names). The issue-level description is already <Summary>, and the issue API calls that one desc too. So mapping series desc to Series/Summary keeps a single word for "description" across the schema. Element names are already reused per parent (Publisher/Name and Series/Name), so Series/Summary next to the top-level Summary follows that precedent and is unambiguous.

Tests

The new cases use #90's TEST_V12_XSD.

  • Valid: all three elements together; each of the Ongoing, Cancelled and Hiatus statuses (Completed is covered by the combined case).
  • Invalid: dup_primary_attr.xml as a v1.2 baseline; status Unknown and lowercase ongoing; a two-digit EndYear; a duplicate Series/Summary; and EndYear against v1.1, which must still reject it.

Validation

  • uv run pytest: 46 passed, including Add v1.2 draft schema with BCP 47 language codes #90's tests. uv run ruff check tests: clean.
  • drafts/v1.2/Sample.xml validates against the v1.2 XSD with xmlschema.XMLSchema11, and is rejected by the v1.1 XSD as expected.
  • The XSD Validation workflow's xmllint command passes for all three XSDs.

Docs

The element documentation on the docs site will need entries for the three elements. As with #90, that could land when v1.2 is released.

bpepple and others added 2 commits October 20, 2026 12:50
The languageCode type only allowed two lowercase letters, so lang rejected three-letter codes (fil, yue) and tags with script or region subtags (pt-BR, zh-Hant). Metron itself stores codes such as pt-br and zh-hans, which fail validation against v1.0 and v1.1.

Start a v1.2 draft from v1.1 and base languageCode on xs:language, requiring a 2-3 letter primary language subtag. Case is not enforced, per BCP 47. Every previously valid value remains valid.

Fixes Metron-Project#89
Adds three optional elements to seriesType in the v1.2 draft schema:

- EndYear (xs:gYear), the counterpart of StartYear.
- Status (seriesStatusType), the series' publication status:
  Cancelled, Completed, Hiatus or Ongoing, as Metron reports it.
- Summary (xs:string), a description of the series, named after the
  issue-level Summary element.

Updates the v1.2 Sample.xml and adds schema validation tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bpepple

bpepple commented Oct 23, 2026

Copy link
Copy Markdown
Member

When we first wrote MetronInfo.xsd, we purposely left out EndYear and Status. Their values can change (though really only for ongoing series), and Kavita, the main consumer we were targeting at the time, didn't write metadata back to files. Storing values that would go stale didn't seem very useful.

That said, I don't want MetronInfo.xsd to be so resistant to change that it stops being useful to end users. Your use case makes sense to me. A tagger could write the series information to all the issues in a series and update them when the status changes. I don't expect many users to need it, but since all three elements are optional, I'm inclined to add them, including Series/Summary. Reusing Summary to match the issue-level element seems like the right call.

We should probably have @Buried-In-Code, @jyggen, and @majora2007 weigh-in.

@bpepple bpepple self-assigned this Oct 23, 2026
Comment thread drafts/v1.2/MetronInfo.xsd Resolved
@ajslater

Copy link
Copy Markdown
Contributor Author

End Year would change rarely. Ideally only once from empty to written and that doesn't seem so bad to me.
But Status could change repeatedly and that might be more troublesome.

I'm interested in reviewer opinions as well.

@jyggen

jyggen commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Not a user of MetronInfo myself, but I think it all sounds reasonable. I don't think the two fields will change frequently enough for it to become a problem. Status is the only somewhat volatile one that could change multiple times during a comic's lifetime, but I guess one could simply see it as "status as of LastModified".

@Buried-In-Code

Copy link
Copy Markdown
Member

I think the metadata files should be for static data only as you cant know if the values are accurate without checking online sources. Series summary is fine as thats not a variable field, but i dont think year end or status should be included. However having them as optional is a nice middle ground if others would like it included

@ajslater

Copy link
Copy Markdown
Contributor Author

Feels like we need Brian to make a ruling. I don't think the fields do any harm. But I'm also happy to drop one or both of the potentially variable fields as soon as a decision is made.

At the moment I'm storing these fields to my Codex database and not writing them portably into comic archive metadata.

@bpepple

bpepple commented Oct 27, 2026

Copy link
Copy Markdown
Member

I don't see anyone strongly opposing adding these, and I think it could be useful for some of it's consumers, so I'm fine with adding them.

I did a quick review of your proposed changes, and about the only thing I'd like to see is some validation to the end year values since we are using XSD 1.1.

@bpepple bpepple left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good over all, just a couple of small items to be looked at.

</xs:restriction>
</xs:simpleType>

<xs:simpleType name="seriesStatusType">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a quick look at Anilist & MangaBaka used:

  • Completed: MangaBaka
  • Finished: Anilist which could be mapped to Completed
  • Releasing: Anilist | MangaBaka, which could be mapped to Ongoing
  • Hiatus: Anilist
  • Unknown: Anilist

Most of those could be mapped to this enum, the only one we might want to add is Unknown.

I'll leave it up to you whether you think we need it or not, since it would be also be valid to just not write this element if is unknown.

Comment thread drafts/v1.2/MetronInfo.xsd Resolved
Adds two XSD 1.1 assertions to seriesType in the v1.2 draft, per review:

- EndYear can't precede StartYear. The years are compared as integers
  after stripping gYear's optional timezone.
- An Ongoing series can't have an EndYear.

Adds valid and invalid test cases for both, including timezoned years.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@bpepple bpepple left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saw you added those assertions I mentioned. Feel free to merge this PR since I believe you've got write permissions to this repo.

We can probably make a minor release once this is merged, since I don't believe there are only other items on the horizon.

@ajslater

Copy link
Copy Markdown
Contributor Author

Thanks. But I don't have have write access, so I can't merge.

@bpepple

bpepple commented Oct 27, 2026

Copy link
Copy Markdown
Member

Thought we had given you permission back when we were finalizing 1.0, but guess I was wrong. Anyway, I'll go ahead and merge this. And unless you can think of any other changes we should make, I'll go ahead and release v1.2

@bpepple
bpepple merged commit 9a7d889 into Metron-Project:master Oct 27, 2026
2 checks passed
ajslater added a commit to ajslater/comicbox that referenced this pull request Oct 27, 2026
* MetronInfo v1.2: Series EndYear, Status and Summary

Upstream merged Series/EndYear, Series/Status and Series/Summary into
v1.2 (Metron-Project/metroninfo#91) and then released v1.2, moving the
XSD from drafts/v1.2 to schema/v1.2 (#92). The tree's XSD is now
byte-identical to the released file.

The three elements map to series.end_year, series.status and
series.summary, which the native formats already carried. Status reuses
SeriesStatusEnum: the labels match Metron's exactly.

v1.2 also asserts that EndYear can't precede StartYear and that an
Ongoing series has no EndYear. Merged metadata can break either, so the
MetronInfo writer leaves EndYear out with a warning instead of writing a
file that fails validation. Native metadata keeps the end year. EndYear
is kept out of the series bidict so its inverse can't write it unguarded.

Written files point schemaLocation at schema/v1.2, since the drafts URL
now 404s, and the docs drop "draft".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Rewrite MetronInfo v1.2 NEWS as changes since v5.4.0

The entries were written as v1.2 support landed in two parts and read as
a log of those parts. Describe the net change from the last release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants