getmango / Mango

Mango is a self-hosted manga server and web reader
https://getmango.app
MIT License
1.69k stars 118 forks source link

[Question] Should the chapter_rename_rule in config.yml still apply? #308

Closed CaligulaCa3sar closed 2 years ago

CaligulaCa3sar commented 2 years ago

My config file still has the default rename rule which should be [Vol.{volume} ][Ch.{chapter} ]{title|id} but with the v2 plugin for Mangadex, my chapters are being renamed with the format of {title|id}[ Vol.{volume}][ Ch.{chapter}]

hkalexling commented 2 years ago

Oh no it's not being used anymore. It was there for the built-in MD downloader that we once had, but now the new MD plugin doesn't use it.

CaligulaCa3sar commented 2 years ago

OK, thank you. I bet you know what my next question is going to be: is it possible to dictate the format for the new plugin in the same way? Currently an undocumented feature, perhaps?

hkalexling commented 2 years ago

Ah yeah good point. Currently the the plugins will tell the main app what the manga title and chapter title are. The main app will then sanitize those removing any illegal characters, and then save the cbz file at library/<manga title>/<chapter title>.cbz. Note that this is true for all available plugins including the MD plugin.

Now for the MD plugin, it is hardcoded to return <chapter title> Vol. <volume number> Ch. <chapter number> as the chapter title. The source code is here. If you know JS, you can simply edit these lines in your own copy of the plugin to format the title however you want.

I am not sure how to generalize this and allow users to customize it without editing the JS file. The original rename rules for the built-in MD downloader was implemented in Crystal and it was quite a complex feature. Porting the same thing to the embedded JS will be tedious and hard to maintain. If you have any good ideas I will be happy to know!

CaligulaCa3sar commented 2 years ago

Thanks for the info. I've forked the project and amended the index.js with my own preference which works perfectly. I will have a good think about any way of making it easily configurable but my skills in coding are rudimentary at best.