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

error opening certain files with special characters in name #2777

Closed
tzarebczan opened this issue Aug 22, 2019 · 4 comments
Closed

error opening certain files with special characters in name #2777

tzarebczan opened this issue Aug 22, 2019 · 4 comments
Assignees
Labels
type: bug Existing functionality is wrong or broken

Comments

@tzarebczan
Copy link
Contributor

See lbry://144BlackestNightby01GreenLantern43Prologuecbz#b

There may be other views/characters affected.

error in console: vendors~comicBookViewer.js:1 Can't load archive! file:///C:/Users/thoma/Downloads/144%20Blackest%20Night%20by%2001%20Green%20Lantern%20 net::ERR_FILE_NOT_FOUND vendors~comicBookViewer.js:1 Request failed TypeError: Failed to fetch

@tzarebczan tzarebczan added the type: bug Existing functionality is wrong or broken label Aug 22, 2019
@btzr-io btzr-io self-assigned this Nov 25, 2019
@btzr-io
Copy link
Collaborator

btzr-io commented Nov 25, 2019

lbry://144BlackestNightby01GreenLantern43Prologuecbz#b

I cant open this archive on my pc either, do you have another example?

@btzr-io
Copy link
Collaborator

btzr-io commented Nov 25, 2019

const regexImage = new RegExp(
  /^[a-zA-Z0-9_@()-][a-zA-Z0-9_.@()-\s]+.(jpeg|jpg|png|bpm|webp)$/
)

https://github.com/btzr-io/Villain/blob/ece4aecfce2c967c19ba1a7cf580cb9299c1a0cd/src/lib/utils.js#L2-L4

This is the new regex for validation of the files names, it should take care of this in most cases

@btzr-io
Copy link
Collaborator

btzr-io commented Jan 11, 2020

Is this still an issue ?

@btzr-io
Copy link
Collaborator

btzr-io commented May 8, 2020

I found the cause of this bug, we can't use the protocol: file:// with special characters because is interpreted as an actual url.

Creating a stream to read the file fixes the issue.

btzr-io added a commit that referenced this issue May 8, 2020
Use this effect instead of the "file://" protocol
@btzr-io btzr-io mentioned this issue May 8, 2020
12 tasks
neb-b pushed a commit that referenced this issue May 13, 2020
Use this effect instead of the "file://" protocol
@neb-b neb-b closed this as completed in dc10a2d May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Existing functionality is wrong or broken
Projects
None yet
Development

No branches or pull requests

2 participants