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 ffmpeg concat file escaping #3776

Merged
merged 1 commit into from
Jan 4, 2025

Conversation

mikiher
Copy link
Contributor

@mikiher mikiher commented Jan 2, 2025

Brief summary

This fixes an escaping issue causing UNC paths not to be read correctly in ffmpeg concat files generated by ABS

Which issue is fixed?

Fixes the re-opened audiobookshelf-windows issue #29.

In-depth Description

The issue was that the \\ chatacters in the beginning of the UNC path were not escaped in the ffmpeg concat file, and therefore the path was mangled.

Rather than escaping those, I fixed this by surrounding file paths in the concat file with single quotes (and consequently also modifying escapeSingleQuotes)

This way is safer, since now the only character that needs escaping inside a file name is a single quote, which the aptly named escapeSingleQuotes function now really does - no other characters (like spaces or backslashes) need to be escaped.

How have you tested this?

I tested with a combination of UNC paths that also contain single quotes.
I tested both codepaths that call writeConcatFile (encode m4b, and stream).

@mikiher mikiher marked this pull request as ready for review January 2, 2025 12:11
@advplyr
Copy link
Owner

advplyr commented Jan 4, 2025

Thanks!

@advplyr advplyr merged commit fdbca4f into advplyr:master Jan 4, 2025
5 checks passed
@mikiher mikiher deleted the fix-ffmpeg-concat-file branch January 5, 2025 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants