Repository navigation
Add Series EndYear, Status & Summary elements to v1.2 draft - #91
Conversation
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>
|
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. |
|
End Year would change rarely. Ideally only once from empty to written and that doesn't seem so bad to me. I'm interested in reviewer opinions as well. |
|
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. |
|
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 |
|
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. |
|
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
left a comment
There was a problem hiding this comment.
Looks good over all, just a couple of small items to be looked at.
| </xs:restriction> | ||
| </xs:simpleType> | ||
|
|
||
| <xs:simpleType name="seriesStatusType"> |
There was a problem hiding this comment.
I did a quick look at Anilist & MangaBaka used:
Completed: MangaBakaFinished: Anilist which could be mapped toCompletedReleasing: Anilist | MangaBaka, which could be mapped toOngoingHiatus: AnilistUnknown: 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.
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>
There was a problem hiding this comment.
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.
|
Thanks. But I don't have have write access, so I can't merge. |
|
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 |
* 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>
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 inMetronInfo.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.Depends on #90
#90 starts the
drafts/v1.2schema, 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 ontomasteronce #90 is in.The elements
All three are
minOccurs="0".seriesTypeis anxs:all, so their order isn't enforced. They sit where a reader would look for them.EndYearxs:gYearStartYearyear_endStatusseriesStatusType(new enum)EndYearstatusSummaryxs:stringAlternativeNames(long text)descEndYearusesStartYear's type,xs:gYear, so the two are always read and validated the same way. I didn't add anEndYear >= StartYearassertion: XPath 2.0 doesn't definelt/geonxs:gYear, so the assertion would have to cast the values as strings. That seemed better left to writers.Statusis a closed enumeration:Cancelled,Completed,Hiatus,Ongoing. These are exactly theSeries.Statuslabels incomicsdb/models/series.py, which the API returns viaget_status_display. The values are listed alphabetically, asformatType's are. The type is namedseriesStatusTypeinstead ofstatusType, so a future issue-level status won't collide with it. There is nodefault: if the element is absent, the status is unknown. AssumingOngoing, which is Metron's database default, would be wrong for files tagged from other sources.Summary(notDescriptionorDesc): MetronInfo names elements after what they mean, not after Metron's API field names (StartYearrather thanyear_began,AlternativeNamesrather thanalt_names). The issue-level description is already<Summary>, and the issue API calls that onedesctoo. So mapping seriesdesctoSeries/Summarykeeps a single word for "description" across the schema. Element names are already reused per parent (Publisher/NameandSeries/Name), soSeries/Summarynext to the top-levelSummaryfollows that precedent and is unambiguous.Tests
The new cases use #90's
TEST_V12_XSD.Ongoing,CancelledandHiatusstatuses (Completedis covered by the combined case).dup_primary_attr.xmlas a v1.2 baseline; statusUnknownand lowercaseongoing; a two-digitEndYear; a duplicateSeries/Summary; andEndYearagainst 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.xmlvalidates against the v1.2 XSD withxmlschema.XMLSchema11, and is rejected by the v1.1 XSD as expected.xmllintcommand 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.