Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is just a proposal for a feature to add a ToC to files that could require them (Compilations of works). I'm not sure how much could this synergize with the platform, so I didn't put a lot of effort in it, I just kept it simple so it is easier to test. This feature comes from the need to know which titles are included on a certain zip file, and probably get direct links to every one of them and index them inside the reader view.
Basically this adds a "toc" key to the archive table in Redis, which would save the whole object as a JSON string, which we will be able to enconde/decode as needed to provide it. I added 2 methods to Archive.pm, one to update the toc data, and the second to remove an element from it, and on the same note, I also added 2 methdos to database.pm, one is to get the ToC already ordered(Because it is not saved this way, every new key is appended), this one in case we want to evade redundance from writting those lines every time we want to decode the ToC and keep it organized, and the second one is to get the list of titles of the ToC(The values of the hash), so if eventually this could be used to include those names as aliases for the archive in the search, well to have a practical way to get that data.
Lastly, just for the purpose of testing, I added a context menu(That only appears if you're logged in) in the reader view, in the pop up where you can see the list of pages as thumbs, which include 3 options: add, edit, and delete a toc content(add and edit are basically the same BTW). Those are for testing only, since I'm not sure which would be a good way to implement the ToC in the Frontend, so maybe it could be removed later.
This is just to present the feature, honestly I'm not sure if is a good feature on first instance, but well, if it might be a good addition, we can check to work it a little more.