Skip to content

Archive viewer #10584

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

Merged
merged 10 commits into from
Jun 21, 2023
Merged

Archive viewer #10584

merged 10 commits into from
Jun 21, 2023

Conversation

hius07
Copy link
Member

@hius07 hius07 commented Jun 15, 2023

Sometimes I am curious about the archive content.
Zip (epub, cbz) only so far.

1

2

3


This change is Reviewable

@hius07 hius07 added the Plugin label Jun 15, 2023
@Frenzie Frenzie added this to the 2023.06 milestone Jun 15, 2023
end
end

local std_out = io.popen("unzip ".."-qql \""..file.."\"")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do that on Android?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taken from

function CreDocument:zipContentExt(fname)
local std_out = io.popen("unzip ".."-qql \""..fname.."\"")

Copy link
Member

@Frenzie Frenzie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm but either improve the description or leave it out ;-)

hius07 and others added 2 commits June 15, 2023 18:48
Comment on lines 171 to 175
function ArcViewer:extractFile(arcfile, filepath)
UIManager:show(ConfirmBox:new{
text = _("Extract this file?") .. "\n\n" .. filepath .. "\n\n" ..
_("If the file already exists, it will be overwritten."),
ok_text = _("Extract"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This plugins only extract files ? and we then have to exit it and go browse to the extraction location to then view the file ?
It is a bit lying to its name :) I would be expecting to view an image in ImageViewer, and any other stuff in TextViewer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'm going to extend the plugin functionality later.

@hius07 hius07 merged commit 54ab0a0 into koreader:master Jun 21, 2023
@hius07 hius07 deleted the arcviewer branch June 21, 2023 04:32
@poire-z
Copy link
Contributor

poire-z commented Jun 30, 2023

Upgraded KOReader today - tried this plugin, but it always shows me "no items" (even on really simple epub filenames without any space or problematic chars).
On my Kobo and on the emulator.

@hius07
Copy link
Member Author

hius07 commented Jun 30, 2023

Does unzip command in Terminal emulator work?

@poire-z
Copy link
Contributor

poire-z commented Jun 30, 2023

unzip is found, and replies. But may be not in the format you expect.

The output of my debian unzip (UnZip 6.00 of 20 April 2009, by Debian) on the emulator:
(added some print(line), print(fsize), print(fname)

    11273  2015-10-07 23:20   text/part0069_split_015.html
nil
nil
      797  2015-10-07 23:20   text/part0070.html
nil
nil

And on my Kobo:

     2101  05-23-17 06:06   OEBPS/titl001.xhtml
nil
nil
      928  05-23-17 06:06   OEBPS/title.css
nil
nil
    59818  05-23-17 06:06   OEBPS/toc.ncx
nil
nil

Your local fsize, fname = string.match(line, "%s+(%d+)%s+%d%d%-%d%d%-%d%d%d%d%s+%d%d:%d%d%s+(.+)") should probably be changed to match these 3 kinds of date time (hoping than on the other devices, only it can change too.)
This seems to work on both the emulator and my (old firmware) Kobo:
local fsize, fname = string.match(line, "%s+(%d+)%s+[-0-9]+%s+[0-9:]+%s+(.+)")
Works on your Kindle ?

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

Successfully merging this pull request may close these issues.

4 participants