@@ -111,90 +111,25 @@ inline constexpr MangaID invalid_manga_id = MangaID{ 0 };
111111struct MangaInfo {
112112 // / The source's own numeric id, when it has one. @ref aniparse::invalid_manga_id (0) = it
113113 // / does not — which is not an error. This is a display/debugging convenience and
114- // / a source-local key; it is neither a cross-source identity (@ref external_ids)
114+ // / a source-local key; it is neither a cross-source identity (@ref MediaInfo:: external_ids)
115115 // / nor the handle to fetch with (@see MangaGetter::serialize).
116116 MangaID id = invalid_manga_id;
117117
118- // / Ids this manga carries on other sites, as the source reports them — the
119- // / consumer's handle for joining the same work across parsers. Empty when the
120- // / source knows none (most reader sites); a metadata source typically knows at
121- // / least its MyAnimeList id. Not this parser's own identity: to address the
122- // / manga here, use the getter (@see MangaGetter::serialize). @see ExternalId
123- std::vector<ExternalId> external_ids;
124-
125- // / The title to show, in whichever language the source leads with (a source that
126- // / carries several picks one; there is no promise it is English or romanized).
127- // / Empty only when the source does not name the manga at all.
128- std::string title;
129- // / The title in the work's original language/script, when the source carries one
130- // / AND it differs from @ref title. nullopt = the source has no separate original
131- // / title, or it is the same string — so a consumer never renders the title twice.
132- std::optional<std::string> original_title;
133- // / Synopsis, plain text plus any links the source marked up. Empty = the source
134- // / gives no description here (usual for a search card, and some works simply
135- // / have none). Not HTML: markup is either flattened into the text or lifted into
136- // / the attributes. @see AttributedText
137- AttributedText description;
138-
139- // / When the manga was last touched on the source (a new chapter, an edit).
140- // / @c nullopt = the source does not state it. Sources differ on what
141- // / counts as an update, so this orders items within one source only.
142- std::optional<ModelDate> update_time;
143- // / When the manga was first published. @c nullopt = the source does not
144- // / state it — common when only a year is known.
145- std::optional<ModelDate> release_time;
146- // / Publication state (ongoing / released / announced / source-specific). A
147- // / default-constructed status (empty name) = the source states none, and reads as
148- // / DefaultAiredStatuses::Other rather than as "released". @see AiredStatus
149- AiredStatus status;
150-
151- // / Opaque change marker for the whole manga, filled from the cheapest
152- // / signal the source exposes (an ETag, an updated-at value, an explicit
153- // / version, or a composite). Compared only for equality: a changed value
154- // / means the source reports the content as a different revision. Equality
155- // / is a cheap "probably unchanged" hint, not a content-integrity guarantee
156- // / (it does not catch a single re-uploaded chapter or mid-list id drift).
157- // / Empty = the source exposes no such signal.
158- std::string revision;
118+ // / The metadata shared with every other domain — title, description, dates, tags,
119+ // / series, previews, rating, external ids, and the rest. @see aniparse::MediaInfo
120+ MediaInfo common;
159121
160122 // / Who wrote it. Its name is empty when the source credits no author (or does not
161123 // / carry the credit in this response); the same person is often credited as both
162124 // / author and artist, in which case both fields name them. @see RelatedUser
163125 RelatedUser author;
164126 // / Who drew it. Empty name = not credited here; see @ref author.
165127 RelatedUser artist;
166- // / The franchise(s)/parent work(s) the source places the manga in, primary first.
167- // / Empty = it places the manga in none — the manga stands alone or the source has
168- // / no such axis. Usually one, but a source that tags by franchise (a doujin's
169- // / parodies, a booru's copyrights) can list several for one work.
170- std::vector<Series> series;
171128
172- // / Cover art and thumbnails, best first (a consumer showing one shows previews
173- // / front()). Empty = the source offers no artwork; the images are fetch
174- // / descriptors, not bytes. @see Image
175- std::vector<Image> previews;
176- // / The source's labels for this manga — genres, themes, whatever axes it tags by,
177- // / flattened into one list. A tag whose @ref Tag::ref is non-empty can be fed
178- // / back into a search; empty = the source lists none in this response.
179- std::vector<Tag> tags;
180-
181- // / Community score, normalized to a 0-10 axis (@see Rating). nullopt = the source
182- // / publishes no score for this manga, which is not the same as a score of zero.
183- std::optional<Rating> rating;
184- // / View/popularity counters. nullopt = the source publishes none. @see ViewStats
185- std::optional<ViewStats> views;
186129 // / The list the authenticated user keeps this manga on (reading, planning, …).
187130 // / nullopt = the request was anonymous, the source has no lists, or the user has
188131 // / not filed this manga — the three are not distinguishable here. @see UserList
189132 std::optional<UserList> user_lists;
190- // / Minimum age the source requires to view the manga, in years. 0 = unrestricted
191- // / or unstated — an adult work is more reliably detected via @ref is_hentai and
192- // / the source's own adult flag. @see AgeRestriction
193- AgeRestriction age_restriction = 0 ;
194-
195- // / The account that posted the manga, on sources where content is user-submitted.
196- // / nullopt = the source has no notion of an uploader (a publisher-side catalog).
197- std::optional<RelatedUser> uploader;
198133
199134 // / How many chapters the source claims the manga has, when it says so up front.
200135 // / nullopt = it does not, and the only way to know is to page chapters_info().
@@ -207,11 +142,6 @@ struct MangaInfo {
207142 // / nullopt = the source does not report it. Distinct from @ref aniparse::MangaInfo::total_chapters — a work
208143 // / is a count of chapters OR, when it has none, a count of pages.
209144 std::optional<long > total_pages;
210-
211- // / The source marks this manga as adult/pornographic. False = it does not mark
212- // / it, which is a weaker statement than "safe": sources differ on where the line
213- // / sits, and one that has no adult flag at all leaves this false throughout.
214- bool is_hentai = false ;
215145};
216146
217147/* *
@@ -299,7 +229,7 @@ struct MangaChapterInfo {
299229 * unchanged — the numbers alone identify a chapter only on sources that
300230 * leave @ref id empty. Cheap: nothing is fetched, the id is copied.
301231 */
302- [[nodiscard]] MangaChapterRef ref () const { return { volume, chapter, id }; }
232+ [[nodiscard]] MangaChapterRef ref () const { return { . volume = volume, . chapter = chapter, . id = id }; }
303233};
304234
305235/* *
0 commit comments