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

Fix video upload failure [e.g. filenames that contain square brackets] #208

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

deldesir
Copy link
Collaborator

@deldesir deldesir commented Jul 1, 2024

This PR fixes failures encountered when video downloaded with yt-dlp are uploaded manually via the upload button. It adds an additional logic to check if the video_id in the filename has a record in xklb-metadata.db (because these videos are generally named with their ids enclosed within brackets). This PR also ensures database is closed automatically, hence the indentation and the use of a context manager (with sqlite3.connect(XKLB_DB_FILE) as conn)

Fixes #203

Tested on Ubuntu 24.04 (LRN2)

@deldesir
Copy link
Collaborator Author

deldesir commented Jul 1, 2024

Screenshot from 2024-07-01 23-59-22

Originally posted by @EMG70 in #203 (comment)

@holta
Copy link
Member

holta commented Jul 6, 2024

It looks like this PR should have been reviewed more stringently — to ensure uploading works no matter what video/photo/MP3 filename is being uploaded — e.g. even when the filename contains unusual / abnormal characters etc:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uploading videos via Calibre-Web fails - 500 Internal Server Error [if filename contains square brackets]
2 participants