Add support for dynamically-loaded metadata source plugins - #156
Closed
quattromeister wants to merge 2 commits into
Closed
quattromeister wants to merge 2 commits into
quattromeister wants to merge 2 commits into
Conversation
Lets a third party add a movie metadata source to Subler without touching Subler's own source or Xcode project: they build a small, loadable .bundle implementing a Foundation-only protocol, and drop it into ~/Library/Application Support/Subler/Plugins. - SublerMetadataPlugin.swift: the protocol a plugin's principal class implements (searchMovie/loadMovieMetadata using plain String/[String: Any] dictionaries only, so a plugin project never needs to link against Subler's own types or MP42Foundation). - MetadataPluginLoader.swift: discovers and loads every .bundle in the Plugins folder, skipping (and logging) anything that fails to load or doesn't conform, so one broken plugin can never take down the rest of Subler. - PluginMetadataService.swift: adapts a loaded plugin to Subler's own MetadataService protocol, so it shows up in the Search Metadata dialog and batch queue provider popups exactly like a built-in source. With no plugin bundles installed -- the common case -- this changes nothing about Subler's behavior. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ETy3zxWgGdZPVzjN3vqbbC
Compile-only verification (no signing, no tests) on a macOS runner: checks out the repo with submodules, then xcodebuilds the Subler target. Runs on every push and PR to any branch, so a branch shows red/green on GitHub before anyone has to open Xcode. This is fork/CI infrastructure, not app code -- merged into every branch that should get build coverage, but deliberately kept off of main so main stays a byte-for-byte mirror of upstream for clean rebasing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ETy3zxWgGdZPVzjN3vqbbC
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Lets a third party add a movie metadata source to Subler without touching Subler's own source or Xcode project: they build a small, loadable
.bundleimplementing a Foundation-only protocol, and drop it into~/Library/Application Support/Subler/Plugins.SublerMetadataPlugin.swift: the protocol a plugin's principal class implements (searchMovie/loadMovieMetadatausing plainString/[String: Any]dictionaries only, so a plugin project never needs to link against Subler's own types or MP42Foundation).MetadataPluginLoader.swift: discovers and loads every.bundlein the Plugins folder, skipping (and logging) anything that fails to load or doesn't conform, so one broken plugin can never take down the rest of Subler.PluginMetadataService.swift: adapts a loaded plugin to Subler's ownMetadataServiceprotocol, so it shows up in the Search Metadata dialog and batch queue provider popups exactly like a built-in source.With no plugin bundles installed -- the common case -- this changes nothing about Subler's behavior.
Also includes this batch's shared GitHub Actions build check (
.github/workflows/build.yml) -- compile-only verification on a macOS runner, so a branch shows red/green on GitHub before anyone opens Xcode. Flagging in case another PR in this batch merges it first, so it doesn't need to land twice -- happy to drop it from whichever PR merges second.