Difegue / LANraragi

Web application for archival and reading of manga/doujinshi. Lightweight and Docker-ready for NAS/servers.
https://lrr.tvc-16.science
MIT License
2.16k stars 151 forks source link

folder name containing invalid characters in the temp folder #832

Open LittleJake opened 1 year ago

LittleJake commented 1 year ago

Please describe your suggestion, and the problem it'd solve.

When comic's filename contains japanese, folder name will contain invalid characters in the temp folder.

Additional context

Snipaste_2023-08-03_22-49-13

image

Difegue commented 1 year ago

👋 This is a known issue -- I never thought it was a real problem considering the temp folder is well, temporary in nature.

Would fixing this help you in any fashion? I'll admit I don't know if the issue is on the libarchive side or if it's just because we're not decoding a folder name properly.

polak14 commented 1 year ago

I think we might have to unzip with shift-jis charset?

LittleJake commented 1 year ago

If not mind, is it okay to use some sort of hash values in place of the exact zip name?

siliconfeces commented 1 year ago

Does it cause an actual problem (like images not showing up) or is it just annoying?

LittleJake commented 1 year ago

Well, it will cause web title showing unexpected characters. Besides, it's not capable to fully backup to windows machine unless in compressed format or ignorance of the temp folder.

Difegue commented 1 year ago

Web title should use whatever's stored in metadata - - I think the only place we show the true filenames is next to the resolution/size metadata in the reader.

LittleJake commented 1 year ago

Web title should use whatever's stored in metadata - - I think the only place we show the true filenames is next to the resolution/size metadata in the reader.

Yep.

Difegue commented 1 year ago

Tagging as volunteers just in case someone cares enough to fix this - I don't think we should use hashes though, that sounds like more trouble than it's worth. (Need to handle internal folders and subfolders in archives, avoid collisions etc etc)

At the same time I'm not convinced we should try guessing charsets and converting on the fly, that's liable to break depending on what filesystem the server is running on -- There's a reason most FS code in the current codebase just uses the raw bytes without trying to do any conversion.

LittleJake commented 1 year ago

@Difegue

Another problem shows up with the encoding.

The place holder will not work as expected.

image

Difegue commented 1 year ago

That's because it's a folder, as mentioned in the error message. There's no need to create a placeholder in those scenarios 😛