Add page removal functionality to Peruse Creator
ClosedPublic

Authored by woltherav on Sep 22 2019, 11:26 AM.

Details

Summary

This enables Peruse Creator to remove pages.

The functionality was missing, despite the button being there, so I implemented it.

Test Plan

Open up a comic with multiple pages in peruse creator. Try removing the cover, try removing any other page.

Diff Detail

Repository
R157 Peruse
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
woltherav requested review of this revision.Sep 22 2019, 11:26 AM
woltherav created this revision.

Looks pretty good, but i'm not entirely certain... we might need to do some housekeeping in the zip file when removing pages, to ensure we don't leave graphics files behind that aren't referenced somewhere (cbzs are already large enough without stray files sitting around inside the archive)... but that seems perhaps like something that'd want to be in the save part of the process, maybe

Looks pretty good, but i'm not entirely certain... we might need to do some housekeeping in the zip file when removing pages, to ensure we don't leave graphics files behind that aren't referenced somewhere (cbzs are already large enough without stray files sitting around inside the archive)... but that seems perhaps like something that'd want to be in the save part of the process, maybe

I thought we were already completely rewriting the zip file in question? If not I'll take a look at ensuring only files that the bookmodel knows about are in the zip file.

leinir accepted this revision.Sep 23 2019, 12:47 PM

Looks pretty good, but i'm not entirely certain... we might need to do some housekeeping in the zip file when removing pages, to ensure we don't leave graphics files behind that aren't referenced somewhere (cbzs are already large enough without stray files sitting around inside the archive)... but that seems perhaps like something that'd want to be in the save part of the process, maybe

I thought we were already completely rewriting the zip file in question? If not I'll take a look at ensuring only files that the bookmodel knows about are in the zip file.

The zip is completely rewritten, yes, but i'm unsure as to whether unreferenced content is removed without actually being told to go away... It's entirely possible, just need checking to make sure (and, well, really, whether or not it does, this could hardly be considered a regression anyway, and probably wants a different diff). Go for it :)

This revision is now accepted and ready to land.Sep 23 2019, 12:47 PM
This revision was automatically updated to reflect the committed changes.

I double checked, and if I remove pages from a file the filesize goes down, so it must be deleting properly :)

I double checked, and if I remove pages from a file the filesize goes down, so it must be deleting properly :)

Thanks, and great! Thought i remembered it doing it like that, but... memory being what it is, good to confirm :)