-
Notifications
You must be signed in to change notification settings - Fork 15
Add custom plugin command for bespoke re-processing (IProcessPlugin) #791
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c301c25
Add custom plugin command for bespoke re-processing (IProcessPlugin)
ptr727 4ffdfa3
Add Custom Plugins to README table of contents
ptr727 e45144a
Fix Docker build context and address plugin review feedback
ptr727 e24f25b
Add application-version pinning example and second-round review fixes
ptr727 90800be
Add parameterless to cspell dictionary
ptr727 e26a17c
Fix docs: parallel default wording and AOT-default consistency
ptr727 d3825e3
Add local markdown/spell lint parity to hook and VS Code tasks
ptr727 19cc1b3
Document custom command in README summary and command list
ptr727 88726b6
Resolve plugin path inside try so a malformed path fails cleanly
ptr727 f3d5a6b
Filter non-Matroska files in the example plugin
ptr727 8f192eb
Document plugin sidecar consistency requirement
ptr727 03d26a7
Comment sidecar state-flag behavior in the example plugin
ptr727 33afc72
Require --pluginassembly only in non-AOT builds
ptr727 86957c6
Match full assembly identity when sharing host assemblies
ptr727 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,29 @@ | ||
| #!/bin/sh | ||
| . "$(dirname "$0")/_/husky.sh" | ||
|
|
||
| # C# formatting and style (CSharpier + dotnet format), see task-runner.json | ||
| dotnet husky run | ||
|
|
||
| # Markdown and spelling lint parity with CI, only when Markdown files are staged. The editor | ||
| # extensions only warn, so this hook is what actually gates a commit on lint errors. markdownlint and | ||
| # cspell are Node tools that do not run reliably across Windows, WSL, and Linux, so run them through | ||
| # Docker (the same way the CLIs are run elsewhere). To keep this hook reliable and never a false | ||
| # blocker, only use images that are already present locally (never pull) and skip when Docker or the | ||
| # image is unavailable; CI enforces these regardless. Warm the images with the VS Code "Lint" tasks. | ||
| # MSYS_NO_PATHCONV keeps the bind mount correct under Git Bash on Windows; it is a no-op on Linux/WSL. | ||
| docs_lint() { | ||
| image="$1" | ||
| shift | ||
| if docker image inspect "$image" >/dev/null 2>&1; then | ||
| MSYS_NO_PATHCONV=1 docker run --rm -v "$(pwd):/workdir" -w /workdir "$image" "$@" || exit 1 | ||
| else | ||
| echo "husky: $image not present, skipping lint (run the VS Code Lint tasks or rely on CI)" | ||
| fi | ||
| } | ||
|
|
||
| if git diff --cached --name-only --diff-filter=ACMR | grep -q '\.md$'; then | ||
| if command -v docker >/dev/null 2>&1; then | ||
| docs_lint davidanson/markdownlint-cli2:latest "**/*.md" | ||
| docs_lint ghcr.io/streetsidesoftware/cspell:latest --no-progress README.md HISTORY.md | ||
| fi | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| namespace PlexCleaner; | ||
|
|
||
| public static class PluginApi | ||
| { | ||
| // Bumped when the IProcessPlugin or IPluginHost contract changes in a breaking way | ||
| public const int Version = 1; | ||
| } | ||
|
|
||
| public interface IPluginHost | ||
| { | ||
| // Compare against the PluginApi.Version the plugin was built against | ||
| int PluginApiVersion { get; } | ||
|
|
||
| // Informational host details for finer compatibility decisions | ||
| string ApplicationVersion { get; } | ||
| string OperatingSystem { get; } | ||
| string Runtime { get; } | ||
|
|
||
| // Plugin log events flow to the host sinks and end-of-run summary | ||
| Serilog.ILogger Logger { get; } | ||
| } | ||
|
|
||
| public interface IProcessPlugin | ||
| { | ||
| // Used in logs and as the processing task name | ||
| string Name { get; } | ||
|
|
||
| // Called once before processing, return false to abort when incompatible with the host | ||
| bool Initialize(IPluginHost host); | ||
|
|
||
| // Called once per media file, reuse the public processing API, return false on failure | ||
| bool ProcessFile(string fileName); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.