Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] suppress part naming in volumes for use with Kavita #44

Closed
AnAngryBrit opened this issue Oct 18, 2023 · 4 comments
Closed
Labels
enhancement New feature or request

Comments

@AnAngryBrit
Copy link
Contributor

In addition to #39 in order to get full compatibility with Kavita the part naming of volumes needs to be suppressed
as generating volumes with different file name but the same metadata will only allow the first volume generated to be accessed without manual file wrangling.

Kavita when executing a library refresh is able to recognise that there is additional content (parts) in an existing file and will update the volume to show that there is additional unread segments and update your bookmark to load the new part.

I am not sure of the best place in which to do this.
in my local testing I have updated line 271 of core.py as follows
title = f"{title_base}" from
title = f"{title_base} [{part_segment}]"

this results in epubs with only the volume in the name
"Hell_Mode_Volume_7_parts_1_to_4.epub" vs
"Hell_Mode_Volume_7.epub"

I am happy to create a PR with a switch that does this.
I would appreciate some discussion on this one around suggested option name and what your willingness to include this might be.

Thanks, AnAngryBrit

@gvellut
Copy link
Owner

gvellut commented Oct 19, 2023

Thank you for your feedback.

Something to that effect will be implemented as part of #29 (either as custom name templates or flags to specify how the default name gets transformed). So it will be a bit more general than what you want (I think the folder name you implemented already could fit in that as well).

Not sure when it will be done though, so if you already have a PR, you can send it and I will include it. For the option name, set it to what you want and I will change it if needed.

@gvellut gvellut added the enhancement New feature or request label Oct 27, 2023
@AnAngryBrit
Copy link
Contributor Author

AnAngryBrit commented Oct 30, 2023

additional part naming comes from core.py line 234 for when the first part of a new volume is created.
_process_single_epub_content
....
title = f"{part.raw_data.title}{suffix}"
does this come directly from j-novel?

todo: add way manipulate this or edit it post assignment.

@gvellut
Copy link
Owner

gvellut commented Jan 22, 2024

Sorry, I had not seen your question. The raw_data attributes come from the JNC API response: when I parse the response, I copy some attributes to the main object for easy access but not all; The whole response is put there.

Anyway, I got around to implement a feature that should answer your request. It allows the renaming of the output EPUB title, its filename or its folder name (using the --subfolder option). It is a bit complex in order to satisfy all use cases (from the orignal renaming issue #29 + some things I needed). I will document it for the next release.

@AnAngryBrit
Copy link
Contributor Author

no worries, I figured that it was coming from the API but since the output was predictable I put in a very dirty hack to solve my issue.
title = f"{part.raw_data.title[:-6]}{suffix}" not especially proud of that one.
I see there are lots changes going in to make naming more dynamic, since you mentioned that you were working on something I didn't put in too much effort. looking forward to the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants