Skip to content

ComicInfo.xml files only use the first description returned (which may be a different language) #174

Description

@FibreTTP

What happened ?

MangaDex supports multiple descriptions for a manga, which are mainly used for alternative languages. They are (probably) returned by the API in the order of their key, which means descriptions with a language code sorted above "en" alphabetically will be first, and thus be the one used in ComicInfo.xml files written.

The language codes are defined here: https://api.mangadex.org/docs/3-enumerations/#language-codes--localization

This does not affect manga_info files.

Examples:

ComicInfo.xml

<ComicInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Series>Ayakashiko</Series>
    <Writer>Hijiki (&#12498;&#12472;&#12461;)</Writer>
    <Penciller>Hijiki (&#12498;&#12472;&#12461;)</Penciller>
    <Genre>Comedy,Fantasy,Slice of Life</Genre>
    <Summary>Die 16 j&#228;hrige Miyatsuka Mahoro verwaltet ein gewisses Haus im historischen Bezirk
        Asakusa Shitamachi. Bewohnt wird das &#12300;Ayakashisou&#12301; bei einer verfressenen
        Zashikiwarashi, einem Kitsune, die es liebt, streiche zu spielen und einer Yukionna, die es
        liebt, im K&#252;hlschrank zu schlafen. Auch wenn sie nicht im Luxus baden, ist doch jeder
        Tag gef&#252;llt mit Spa&#223; und &#196;rger.</Summary>
    <AlternateSeries>Ayakashi-ko,&#1040;&#1103;&#1082;&#1072;&#1089;&#1080;&#1082;&#1086;,&#12354;&#12420;&#12363;&#12375;&#12371;,&#22934;&#24618;&#23429;&#38498;,&#44340;&#51060;&#54620;
        &#50500;&#51060;</AlternateSeries>
    <Volume>1</Volume>
    <LanguageISO>en</LanguageISO>
    <Number>1</Number>
    <Title />
    <ScanInformation>LoreScans</ScanInformation>
    <PageCount>37</PageCount>
    <Web>https://mangadex.org/chapter/0b52ba71-8732-4359-9bae-3ce9561cf3c4</Web>
</ComicInfo>

curl https://api.mangadex.org/manga/a7743106-23b9-405e-a5a1-99854e4948ec

{
    "result": "ok",
    "response": "entity",
    "data": {
        "id": "a7743106-23b9-405e-a5a1-99854e4948ec",
        "type": "manga",
        "attributes": {
            "title": {
                "en": "Ayakashiko"
            },
            "altTitles": [
                {
                    "en": "Ayakashi-ko"
                },
                {
                    "ru": "\u0410\u044f\u043a\u0430\u0441\u0438\u043a\u043e"
                },
                {
                    "ja": "\u3042\u3084\u304b\u3057\u3053"
                },
                {
                    "zh": "\u5996\u602a\u5b85\u9662"
                },
                {
                    "ko": "\uad34\uc774\ud55c \uc544\uc774"
                }
            ],
            "description": {
                "de": "Die 16 j\u00e4hrige Miyatsuka Mahoro verwaltet ein gewisses Haus im historischen Bezirk Asakusa Shitamachi. Bewohnt wird das \u300cAyakashisou\u300d bei einer verfressenen Zashikiwarashi, einem Kitsune, die es liebt, streiche zu spielen und einer Yukionna, die es liebt, im K\u00fchlschrank zu schlafen. Auch wenn sie nicht im Luxus baden, ist doch jeder Tag gef\u00fcllt mit Spa\u00df und \u00c4rger.",
                "en": "16 year old Miyatsuka Mahoro is the manager of a certain mansion located in downtown Asakusa. The name of the mansion, Ayakashi-sou is inhabited by a glutton Zashikiwarashi, a Kitsune who loves to play pranks and a Yukionna that likes to sleep in the refrigerator. Even though they are poor, they spend each day having fun and causing trouble. Welcome to the life of living with Ayakashi!"
            },
            "isLocked": false,
            "links": {
                "al": "98694",
                "ap": "ayakashiko",
                "bw": "series\/153406",
                "kt": "39334",
                "mu": "119942",
                "amz": "https:\/\/www.amazon.co.jp\/gp\/product\/B074C4ZTJW\/",
                "cdj": "http:\/\/www.cdjapan.co.jp\/product\/NEOBK-1880843",
                "ebj": "https:\/\/ebookjapan.yahoo.co.jp\/books\/342673\/",
                "mal": "95377"
            },
            "originalLanguage": "ja",
            "lastVolume": "8",
            "lastChapter": "64.5",
            "publicationDemographic": "seinen",
            "status": "completed",
            "year": 2015,
            "contentRating": "safe",
            "tags": [
                {
                    "id": "4d32cc48-9f00-4cca-9b5a-a839f0764984",
                    "type": "tag",
                    "attributes": {
                        "name": {
                            "en": "Comedy"
                        },
                        "description": {},
                        "group": "genre",
                        "version": 1
                    },
                    "relationships": []
                },
                {
                    "id": "cdc58593-87dd-415e-bbc0-2ec27bf404cc",
                    "type": "tag",
                    "attributes": {
                        "name": {
                            "en": "Fantasy"
                        },
                        "description": {},
                        "group": "genre",
                        "version": 1
                    },
                    "relationships": []
                },
                {
                    "id": "e5301a23-ebd9-49dd-a0cb-2add944c7fe9",
                    "type": "tag",
                    "attributes": {
                        "name": {
                            "en": "Slice of Life"
                        },
                        "description": {},
                        "group": "genre",
                        "version": 1
                    },
                    "relationships": []
                }
            ],
            "state": "published",
            "chapterNumbersResetOnNewVolume": false,
            "createdAt": "2019-02-10T21:39:15+00:00",
            "updatedAt": "2024-05-23T21:55:37+00:00",
            "version": 13,
            "availableTranslatedLanguages": [
                "en",
                "ru",
                "id",
                "de"
            ],
            "latestUploadedChapter": "387d62e4-6675-429d-8467-3bebe7d74cf6"
        },
        "relationships": [
            {
                "id": "09a8ba69-82a4-4aad-be0c-68539f704ed2",
                "type": "author"
            },
            {
                "id": "09a8ba69-82a4-4aad-be0c-68539f704ed2",
                "type": "artist"
            },
            {
                "id": "be109d65-1ba4-4f48-beec-480ca48aeb2e",
                "type": "cover_art"
            }
        ]
    }
}

What did you expect to happen ?

I expected the language of description inserted in ComicInfo.xml files to match the language given by --language, and default to English.

OS version

Windows 11 Enterprise 25H2

App version

mangadex-downloader v3.1.4 (https://github.com/mansuf/mangadex-downloader)
Python: 3.13.3
arch: x64
bundled executable: no

Installation origin

git clone && python setup.py install

Installation origin (other sources)

No response

Reproducible command

python run.py --language English --start-chapter 1 --end-chapter 1 --start-page 1 --end-page 1 --path "./{manga.title}" --save-as cbz https://mangadex.org/title/a7743106-23b9-405e-a5a1-99854e4948ec/ayakashiko

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions