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

Contextually set a Source.probe's FFprobe input type based upon URI #14

Merged
merged 3 commits into from
Feb 24, 2020

Conversation

agrathwohl
Copy link
Contributor

This PR introduces code in Source.probe, which sets the FFprobe input as a file path string when the Source.uri begins with file://, 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.

@agrathwohl agrathwohl requested a review from jwerle February 24, 2020 21:57
source.js Outdated
const { uri } = this
const stream = this.createReadStream(opts)
const stream = this.uri.includes('file://') ?
Copy link
Contributor

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?

Copy link
Contributor Author

@agrathwohl agrathwohl Feb 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fo' sho - a92388d

@agrathwohl agrathwohl requested a review from jwerle February 24, 2020 22:25
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://') ?
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@agrathwohl agrathwohl requested a review from jwerle February 24, 2020 23:04
@agrathwohl agrathwohl merged commit 0f13c8d into master Feb 24, 2020
@agrathwohl agrathwohl deleted the andrew/fixprobe branch February 24, 2020 23:44
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