-
Notifications
You must be signed in to change notification settings - Fork 2
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
Contextually set a Source.probe's FFprobe input type based upon URI #14
Conversation
…th, rather than a ReadableStream
source.js
Outdated
const { uri } = this | ||
const stream = this.createReadStream(opts) | ||
const stream = this.uri.includes('file://') ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we have a null check for this.uri
in case it isn't available and only a stream can be created?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fo' sho - a92388d
source.js
Outdated
@@ -223,7 +223,7 @@ class Source extends Resource { | |||
|
|||
|
|||
const { uri } = this | |||
const stream = this.uri.includes('file://') ? | |||
const stream = this.uri !== undefined && this.uri.includes('file://') ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check for null
instead? or just a truthy check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
This PR introduces code in
Source.probe
, which sets the FFprobe input as a file path string when the Source.uri begins withfile://
, and for all other types of URIs, sets the input as a ReadableStream.Address the concerns raised in #13 - mainly, that sending Sources with a file:// URI degrades the potential data quality FFprobe can return when probing for container-level metadata.