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]: "streaming reading" from web server #260

Closed
1 task done
GeistPrisma opened this issue Aug 18, 2024 · 1 comment
Closed
1 task done

[Feature Request]: "streaming reading" from web server #260

GeistPrisma opened this issue Aug 18, 2024 · 1 comment

Comments

@GeistPrisma
Copy link

Preflight Checklist

  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Describe your suggested feature

To read the comic from web server, OpenComic need to download the full file. Most manga files are in cbz format, which is the same format as zip. Due to the unique structure of ZIP file, it support reading the contained files even if the download is incomplete. Therefore, if the files are stored on a server that supports partial downloads, such as WebDAV or SMB, we can achieve streaming reading by parsing the structure of the ZIP file, without needing to download the entire file.

Additional Information

zip structure https://en.wikipedia.org/wiki/ZIP_(file_format)#Structure
stream unzip https://github.com/ShiinaRinne/ZipStreamLoader
https://github.com/mhr3/unzip-stream

Sample file

I have yet to find a comic reader on Windows that supports this feature. The KedaReader on the App Store and the WoWo Comic Reader on google play store have implemented this feature very well.

@ollm
Copy link
Owner

ollm commented Aug 18, 2024

This probably can't be done, zip file format isn't really meant to be processed by streaming (unzip-stream#note), and OpenComic also supports more types of compressed files/servers, that would cause more difficulties in its implementation. Also it would be incompatible with some features, currently when a file has been downloaded for reading, it is temporarily saved for future reading in tmp folder, and is not downloaded again, It is only deleted when the size set from the settings is exceeded (4GB by default). Because of this, there is also an offline reading feature that attempts to read from temporary files when there is no connection to the server.

Due this and other reasons, I have no plans to implement this feature.

Now "webdav://" connects to the server correctly. However, when switching to Library label or serve label, OpenComic will auto download all files from the webdav server. "smb://" has the same problem ,the other serves I haven't tested yet.
Originally posted by @GeistPrisma in #239 (comment)

About this, it's a bug, OpenComic downloads the files to generate the thumbnails, but it wasn't reading the cached data correctly afterwards, downloading them again every time, as far as I could see, it only happened in compressed files, I push this fix 7e739da, but if you detect some repetitive behavior, it's possible that there is still some other bugs.

Build: https://mega.nz/file/bSgCGRiQ#aHDL5Q8rmEBTfhbuy0pqH0sjorlSPs31A9iquEul9W8

Additionally, if you want to speed up more the reading of your server by OpenComic, you can do the following:

Structure in folders/subfolders
If you structure your server in folders and subfolders, OpenComic will only download the first 4 files in each folder to generate the thumbnails.

Have the files already extracted
If you already have the files extracted, OpenComic will download only the image needed for the thumbnail.

Although it is likely that with just the fix it will work much better for you.

@ollm ollm closed this as not planned Won't fix, can't repro, duplicate, stale Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants