LANraragi icon indicating copy to clipboard operation
LANraragi copied to clipboard

ToC metadata for archive

Open EfronC opened this issue 8 months ago • 2 comments

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.

image

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.

EfronC avatar Oct 25 '23 19:10 EfronC