Mango
Mango copied to clipboard
[Feature Request] MangaDex in API Improvements
Thanks for the great project, have been experimenting with it, and am enjoying the automatic mangadex download utility. I am planning on trying to integrate this as a server option for tachiyomi and Neko. There are a few things that would really help me in this process:
- Report the mangadex id and chapter ids in the api
- An api endpoint which allows for returning of the mango "book" queried by mangadex id
Describe the solution you'd like
What would be nice is if the local manga has a mangadex id, that the API reports this and the chapter id.
I see that it is stored in the queue db, but the actual /api/library or /api/book/ don't report this external manga and chapter id.
I am not sure how this will work for multiple plugins, but a simple way would to have these as additional columns in the database that could then be displayed in the api (for example a id_mangadex in both the titles and entries). If the manga is not one downloaded from mangadex, this value could just report null.
Additionally, it would be nice to have an API endpoint to return a local "book" based on the mangadex id and not the id that mango uses. This would be useful for quickly checking if mango has a given mangadex manga downloaded.
Additional context For example this would be ideal for this manga:
{
"dir": "/root/mango/library",
"titles": [
{
"dir": "/root/mango/library/Tondemo Skill de Isekai Hourou Meshi_ Sui no Daibouken",
"title": "Tondemo Skill de Isekai Hourou Meshi_ Sui no Daibouken",
"id": "8bed99917ac34a63a97987103dcf21c2",
"id_mangadex": "37392", //< ***THIS HAS BEEN ADDED***
"signature": 4246339266,
"display_name": "Tondemo Skill de Isekai Hourou Meshi_ Sui no Daibouken",
"cover_url": "/api/cover/8bed99917ac34a63a97987103dcf21c2/a85eeb6ca9f34b1caefc0402e4920217",
"mtime": 1614579729,
"titles": [],
"entries": [
{
"zip_path": "/root/mango/library/Tondemo Skill de Isekai Hourou Meshi_ Sui no Daibouken/Vol.1 Ch.1 The Man Dragged into Another World, Fenrir, and the Slime.cbz",
"title": "Vol.1 Ch.1 The Man Dragged into Another World, Fenrir, and the Slime",
"size": "6.22MiB",
"id": "a85eeb6ca9f34b1caefc0402e4920217",
"id_mangadex": "635134", //< ***THIS HAS BEEN ADDED***
"title_id": "8bed99917ac34a63a97987103dcf21c2",
"display_name": "Vol.1 Ch.1 The Man Dragged into Another World, Fenrir, and the Slime",
"cover_url": "/api/cover/8bed99917ac34a63a97987103dcf21c2/a85eeb6ca9f34b1caefc0402e4920217",
"pages": 22,
"mtime": 1614579069
}
],
"parents": []
}
]
}
Hi, thank you for your interest in working on the Tachiyomi integration!
Yes I agree these are all useful features to have, but currently we do not store the MangaDex IDs of chapters and manga downloaded from MD. The queue.db contains the download queue, but after the download is completed the rows will be deleted. We could store the MD IDs for future downloads, but then the old chapters won't have the IDs and this would break the user expectations. I can't think of a user-friendly way to handle this, but any suggestions are welcome!
Maybe notice the user that he need to redownload said manga for it to be integrated. Or add a id field in the manga edit. Both are not great I reckon but do the job.
Yeah, I am not sure about how to support existing manga's / chapters downloaded, but I think for new ones download this would be a nice addition.
As Nerothos mentioned, the web interface could also show this id / chapter and I think it would be nice to have it linked directly to the mangdex (similar to how the download plugin rows gives links to the chapters so you can click and view it on mangadex).
Seems like a bit of work, so I think just having it would be stored for newly downloaded chapters / mangas would be the best solution for me (right now I am fine with re-downloading everything)
I created a first version of it here: https://github.com/tachiyomiorg/tachiyomi-extensions/pull/6034
Some improvements that would be make this work really nicely:
- Pull and store the manga description (and maybe tags?)
- Have the manga thumbnail be set the one on mangadex by default (not sure how they are generated now, but seems to be a random page in the manga)
@Nerothos Adding an extra field for the MD ID sounds like a good idea 👍 Will try to implement this.
@goldbattle Thanks for your effort on the extension! Hopefully we can close #33 with it. Regarding the improvements:
- Yes, I agree we should store more metadata. I would love each manga to have a wide array of metadata fields that you can edit (similar to what they have in Plex), and it would be even better if manga downloaded from MD would have these fields automatically filled in. I am currently (slowly) working on #148, and this feature can come after that.
- Currently we use the first page of the first entry in a title as its thumbnail. I agree it would be nice to retrieve the thumbnails from MD.
So to summarize, the features requested in this issue are:
- [ ] Store the MD IDs of manga and chapters downloaded from MD.
- [ ] Add some additional fields to the manga edit modal. We can include the MD ID, description, cover URL and artists/publishers.
- [ ] Automatically fetch metadata (including the MD cover URL) for manga and chapters downloaded from MD.
I was wondering, @goldbattle, I'm not sure if that's feasible from source plugin on Tachiyomi but would it be possible to sync read chapter between the two? I doubt source plugin allow API call while reading though
Correct, this type of support is being tracked here: https://github.com/tachiyomiorg/tachiyomi/issues/4282
@goldbattle Congrats on getting the PR merged! I wanted to try the extension but encountered an issue, and would appreciate your help.
I was trying to configure the extension by tapping the gear icon, but this crashed the app. The same icon works without any issues for other extensions. Is this a bug or am I missing something? I am using the latest version of Tachiyomi (0.10.9).
@hkalexling He is already working on it This is what he said in a new PR "Would crash on startup if the address field is empty since it has zero length so you can't get a .last()."
@dmswd Ah I didn't see the new PR. Thanks for letting me know!
@hkalexling you're welcome 😊