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

Add option for post-processing command/script #78

Merged
merged 2 commits into from Jul 5, 2021
Merged

Conversation

peskdale
Copy link
Contributor

@peskdale peskdale commented Jul 5, 2021

I wanted a way to send a notification when a new video landed. The easiest way I could think to do it was to just have a user-defined command be run after completion.

This reuses the same string replacements of filePathFormatting, so I have broken that out into a separate function.

Disclaimer: other than odd tweaks to existing code, I have never done any proper work with typescript before. Feel free to make changes to the code to suit standards and/or personal taste.

@Inrixia Inrixia self-requested a review July 5, 2021 18:53
@Inrixia Inrixia self-assigned this Jul 5, 2021
@Inrixia Inrixia added this to In progress in v5.1.0 Release via automation Jul 5, 2021
@Inrixia Inrixia added this to the v5.1.0 Release milestone Jul 5, 2021
Copy link
Owner

@Inrixia Inrixia left a comment

Choose a reason for hiding this comment

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

Looks good, Ill probably add a proper example in the wiki on how to use it before the next release.

@Inrixia
Copy link
Owner

Inrixia commented Jul 5, 2021

Ill also need to add some error handling as if the command fails the download shouldn't fail. re issue #79
And swapout the exec to a use util.promisify as seen below (basically the same as what you did):

import { exec as execOriginal } from "child_process";
import { promisify } from "util";
const exec = promisify(execOriginal);

Otherwise thanks for the added functionality :)

@Inrixia Inrixia merged commit c21350c into Inrixia:dev Jul 5, 2021
v5.1.0 Release automation moved this from In progress to Done Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants