### Example plugin implementation (MainClass) Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/plugin-system.md Shows a minimal plugin implementing the Plugin interface. The init() method receives a PluginContext whose dataDir() and configDir() already exist as directories. Use start() to subscribe to Fetcharr events and stop() for cleanup. ```java package example; import me.egg82.fetcharr.api.plugin.Plugin; import me.egg82.fetcharr.api.plugin.PluginContext; public class MainClass implements Plugin { @Override public void init(PluginContext context) throws Exception { // context.dataDir() and context.configDir() already exist as directories } @Override public void start() throws Exception { // subscribe to Fetcharr events here } @Override public void stop() throws Exception { // clean up } } ``` -------------------------------- ### Example — a plugin adding its own destination Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/webhook-plugin.md Shows how to obtain the WebhookAPI instance and register a custom destination. The commented alternative uses FetcharrAPIProvider to get the first WebhookAPI implementation. ```java import me.egg82.fwebhook.api.WebhookAPI; import me.egg82.fwebhook.api.WebhookAPIProvider; WebhookAPI api = WebhookAPIProvider.instance(); // or: FetcharrAPIProvider.instance().registry().getFirst(WebhookAPI.class); boolean ok = api.register(new MyDestination(...)); ``` -------------------------------- ### Main class skeleton with static initializer and methods Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/app-main.md Declares the Main class with a static initializer for tinylog configuration, a volatile running flag, and method signatures for the entry point and setup routines. The static block configures logging; main() orchestrates startup, and setup methods register each app instance. ```java public class Main { static { /* tinylog configuration */ } private static volatile boolean running = true; public static void main(String[] args); private static void setupUnirest(); private static void setupRadarr(int num); private static void setupSonarr(int num); private static void setupLidarr(int num); private static void setupReadarr(int num); private static void setupWhisparr(int num); private static boolean isCacheWritable(); } ``` -------------------------------- ### Example plugin.yaml configuration Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/plugin-system.md Example plugin.yaml file showing required and optional fields for plugin metadata. The id field is required and must match [a-z0-9._-]+, name, version, and class are required, while description, authors, and exports are optional. The class field must be the class implementing the Plugin interface. ```yaml id: unique-id name: Some name version: 1.0.0 description: Whatever description authors: [some, authors] class: example.MainClass exports: - example.another.package.path.to.api ``` -------------------------------- ### Example — inspecting loaded plugins Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/plugin-system.md Iterates over all loaded plugins and prints their ID, name, and version using the FetcharrAPIProvider. ```java import me.egg82.fetcharr.api.FetcharrAPIProvider; FetcharrAPIProvider.instance().pluginManager().plugins().forEach(p -> { System.out.printf("Plugin %s (\"%s\") v%s%n", p.descriptor().id(), p.descriptor().name(), p.descriptor().version()); }); ``` -------------------------------- ### Example: get SONARR_0_URL with ArrConfigVars.get Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/app-config.md Shows how to retrieve a per-instance value using `ArrConfigVars.get`. The `get` method never returns the `{ARR}_{ID}_...` template itself; the template is only the env name, and the value (`def()`) is returned when the env var is absent. ```java import me.egg82.arr.common.ArrType; import me.egg82.fetcharr.config.ArrConfigVars; String url = ArrConfigVars.get(ArrConfigVars.URL, ArrType.SONARR, 0); // SONARR_0_URL ``` -------------------------------- ### Deploy Fetcharr with Docker Compose Source: https://github.com/egg82/fetcharr/blob/main/README.md Use this docker-compose service definition to run Fetcharr with the same environment variables and volume mounts as the Docker CLI example. The container restarts unless stopped. ```dockerfile services: fetcharr: image: egg82/fetcharr:latest container_name: fetcharr hostname: fetcharr environment: - VERIFY_CERTS=true - SSL_PATH=/etc/ssl/certs/ca-bundle.crt - SEARCH_AMOUNT=5 - SEARCH_INTERVAL=1hour - RADARR_0_URL=https://radarr.home.lab - RADARR_0_API_KEY=e8ea891d72ff973fa6db0d34369a60a7 - SONARR_0_URL=https://sonarr.home.lab - SONARR_0_API_KEY=71730b5dfaa4293fe0c050844c10df66 - SONARR_1_URL=https://anime.home.lab - SONARR_1_API_KEY=bdb84dc8e4b787c76be8aae2dfe9bd19 volumes: - ./config:/app/config - ./cache:/app/cache - ./logs:/app/logs - ./plugins:/app/plugins restart: unless-stopped ``` -------------------------------- ### PluginManager interface Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/plugin-system.md Defines the lifecycle methods for managing plugins: init, start, plugins, and shutdown. init() and start() are guarded to run only once. shutdown() calls Plugin.stop() on each plugin and closes each plugin ClassLoader. ```java public interface PluginManager { void init(); void start(); @NotNull PVector<@NotNull EnabledPlugin> plugins(); void shutdown(); } ``` -------------------------------- ### GET /api/v1/command Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches a list of CommandResource objects representing current or past commands. ```APIDOC ## GET /api/v1/command ### Description Fetches a list of CommandResource objects representing current or past commands. ### Method GET ### Endpoint /api/v1/command ### Response #### Success Response (200) - **CommandResource** (object) - List of command resources #### Response Example ```json [ { "id": 1, "name": "AuthorSearch", "authorId": 1 } ] ``` ``` -------------------------------- ### GET /api/v1/edition Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches a list of EditionResource objects. ```APIDOC ## GET /api/v1/edition ### Description Fetches a list of EditionResource objects. ### Method GET ### Endpoint /api/v1/edition ### Response #### Success Response (200) - **EditionResource** (object) - List of edition resources #### Response Example ```json [ { "id": 1, "bookId": 1, "title": "Edition Title" } ] ``` ``` -------------------------------- ### Run Docker container as root with PUID/PGID remap Source: https://github.com/egg82/fetcharr/blob/main/README.md Starts the container as root and uses PUID/PGID environment variables to remap the user after startup. Allows Fetcharr to modify volume mounts, but is less secure. ```bash docker run \ --user 0:0 \ -e PUID=99 -e PGID=100 \ ... \ egg82/fetcharr:latest ``` -------------------------------- ### Artist and album fetches example Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/arr-lib-lidarr.md Shows fetching Artist resources and then Album resources filtered by artistId. Uses LidarrV1API with base URL and API key; returns null if fetch fails. ```java import me.egg82.arr.lidarr.LidarrV1API; import me.egg82.arr.lidarr.v1.Album; import me.egg82.arr.lidarr.v1.Artist; LidarrV1API api = new LidarrV1API("https://lidarr.home.lab", "key", 0); Artist artists = api.fetch(Artist.class); if (artists == null) { return; } for (var artist : artists.resources()) { Album albums = api.fetch(Album.class, java.util.Map.of("artistId", artist.id())); // albums.resources() -> List } ``` -------------------------------- ### Plugin interface lifecycle methods Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/plugin-system.md Defines the lifecycle contract for Fetcharr plugins. init() is called at startup before start(); a thrown exception disqualifies the plugin. start() is called after init(); a thrown exception is logged but the plugin stays loaded. stop() is called at shutdown; a thrown exception is logged and then the plugin's ClassLoader is closed. ```java public interface Plugin { void init(@NotNull PluginContext context) throws Exception; void start() throws Exception; void stop() throws Exception; } ``` -------------------------------- ### Example — weighting a custom collection Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/app-updaters.md Shows how to use WeightedRandom with a custom type that implements Weighted. Creates a WeightedRandom from a list of MyItem instances and selects one via selectOne(). ```java import me.egg82.fetcharr.util.Weighted; import me.egg82.fetcharr.util.WeightedRandom; import java.time.Instant; import java.util.List; List items = List.of(new MyItem(Instant.now().minusSeconds(3600)), ...); WeightedRandom r = new WeightedRandom<>(items); MyItem next = r.selectOne(); ``` -------------------------------- ### Run Fetcharr with Docker CLI Source: https://github.com/egg82/fetcharr/blob/main/README.md Use this command to run Fetcharr in a Docker container with environment variables for configuration and volume mounts for config, cache, logs, and plugins. Replace the example API keys and URLs with your own. ```bash docker run \ -e VERIFY_CERTS=true \ -e SSL_PATH=/etc/ssl/certs/ca-bundle.crt \ -e SEARCH_AMOUNT=5 \ -e SEARCH_INTERVAL=1hour \ -e RADARR_0_URL=https://radarr.home.lab \ -e RADARR_0_API_KEY=e8ea891d72ff973fa6db0d34369a60a7 \ -e SONARR_0_URL=https://sonarr.home.lab \ -e SONARR_0_API_KEY=71730b5dfaa4293fe0c050844c10df66 \ -e SONARR_1_URL=https://anime.home.lab \ -e SONARR_1_API_KEY=bdb84dc8e4b787c76be8aae2dfe9bd19 \ -v ./config:/app/config \ -v ./cache:/app/cache \ -v ./logs:/app/logs \ -v ./plugins:/app/plugins \ egg82/fetcharr:latest ``` -------------------------------- ### Whisparr API usage example Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/arr-lib-whisparr.md Shows how to fetch Movie resources and send a MoviesSearchCommand. Fetches all movies, filters for monitored ones without files, prints missing titles, then sends a search command for movie IDs 1 and 2. ```java import me.egg82.arr.whisparr.WhisparrV3API; import me.egg82.arr.whisparr.v3.Movie; import me.egg82.arr.whisparr.v3.MoviesSearchCommand; import me.egg82.arr.whisparr.v3.schema.CommandResource; WhisparrV3API api = new WhisparrV3API("https://whisparr.home.lab", "key", 0); Movie all = api.fetch(Movie.class); if (all == null) { return; } all.resources().stream() .filter(m -> m.monitored() && !m.hasFile()) .forEach(m -> System.out.println("Missing: " + m.title())); CommandResource result = api.send(new MoviesSearchCommand(new int[] { 1, 2 }), CommandResource.class); ``` -------------------------------- ### GET /api/v3/command Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches a list of commands from Sonarr. Returns an array or object of CommandResource. ```APIDOC ## [GET] /api/v3/command ### Description Fetches a list of commands from Sonarr. Returns an array or object of CommandResource. ### Method GET ### Endpoint /api/v3/command ### Response #### Success Response (200) - **body** (array/object) - CommandResource #### Response Example ```json { "id": 1, "name": "SeriesSearch" } ``` ``` -------------------------------- ### Webhook plugin register and consume example Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/registry.md Demonstrates both registering and consuming an API in the Webhook plugin. Registration makes the API reachable via WebhookAPIProvider, while consumption prefers the registry to allow another plugin to take over. ```java // register — also makes it reachable via me.egg82.fwebhook.api.WebhookAPIProvider FetcharrAPIProvider.instance().registry().register(this, WebhookAPI.class, api); // consume at event time — prefer the registry so another plugin can take over: WebhookAPI api = FetcharrAPIProvider.instance().registry().getFirst(WebhookAPI.class); ``` -------------------------------- ### RadarrV3API usage example Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/arr-lib-api.md Shows how to instantiate a RadarrV3API, validate the endpoint, fetch a Movie by id, and send a MoviesSearchCommand. The fetch with id 0 is ignored unless implemented per type; a null or negative result id indicates the search command was rejected. ```java import me.egg82.arr.radarr.RadarrV3API; import me.egg82.arr.radarr.v3.Movie; import me.egg82.arr.radarr.v3.MoviesSearchCommand; import me.egg82.arr.radarr.v3.schema.CommandResource; RadarrV3API api = new RadarrV3API("https://radarr.home.lab", "e8ea891d72ff973fa6db0d34369a60a7", 0); if (!api.valid()) { System.err.println("Not a Radarr v3 endpoint"); return; } Movie all = api.fetch(Movie.class, 0); // id ignored unless implemented per type CommandResource result = api.send(new MoviesSearchCommand(new int[] { 1, 2 }), CommandResource.class); if (result == null || result.id() < 0) { System.err.println("Search command was rejected"); } ``` -------------------------------- ### GET /api/v1/downloadclient Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches download clients from Lidarr. Returns an array or object of DownloadClientResource. ```APIDOC ## [GET] /api/v1/downloadclient ### Description Fetches download clients from Lidarr. Returns an array or object of DownloadClientResource. ### Method GET ### Endpoint /api/v1/downloadclient ### Response #### Success Response (200) - **body** (array/object) - DownloadClientResource #### Response Example ```json { "id": 1, "name": "Example Client" } ``` ``` -------------------------------- ### Example plugin config.yaml Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/webhook-plugin.md Default configuration file for the Webhook plugin, defining two webhooks: one for Discord and one for Notifiarr. Each webhook has an enabled flag, type, URL, event toggles, and optional API key/channel ID/ping settings. ```yaml webhooks: my-webhook-1: enabled: false type: discord url: https://discord.com/api/webhooks/... events: search: true update: false skip: false my-webhook-2: enabled: false type: notifiarr url: https://notifiarr.com/api/v1/notification/passthrough/ api-key: notifiarr-passthrough-key channel-id: 123456789012345678 events: search: true update: false skip: false ping: user-id: 0 role-id: 0 ``` -------------------------------- ### GET /api/v1/command Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches a list of commands from Lidarr. Returns an array or object of CommandResource. ```APIDOC ## [GET] /api/v1/command ### Description Fetches a list of commands from Lidarr. Returns an array or object of CommandResource. ### Method GET ### Endpoint /api/v1/command ### Response #### Success Response (200) - **body** (array/object) - CommandResource #### Response Example ```json { "id": 1, "name": "ArtistSearch" } ``` ``` -------------------------------- ### GET /api/v3/qualityprofile Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches quality profiles from Sonarr. Returns an array or object of QualityProfileResource. ```APIDOC ## [GET] /api/v3/qualityprofile ### Description Fetches quality profiles from Sonarr. Returns an array or object of QualityProfileResource. ### Method GET ### Endpoint /api/v3/qualityprofile ### Response #### Success Response (200) - **body** (array/object) - QualityProfileResource #### Response Example ```json { "id": 1, "name": "HD" } ``` ``` -------------------------------- ### Subscribing to events with FetcharrAPIProvider Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/fetcharr-api.md Shows how to subscribe to FetcharrEvent using the singleton provider. The example listens for RadarrUpdateMovieEvent and prints the movie title before update. ```java import com.sasorio.event.EventConfig; import me.egg82.fetcharr.api.FetcharrAPIProvider; import me.egg82.fetcharr.api.event.FetcharrEvent; import me.egg82.fetcharr.api.event.update.radarr.RadarrUpdateMovieEvent; FetcharrAPIProvider.instance().events() .subscribe(FetcharrEvent.class, EventConfig.of(Integer.MAX_VALUE, false, false), event -> { if (event instanceof RadarrUpdateMovieEvent e) { System.out.println("About to update movie: " + e.resource().title()); } }); ``` -------------------------------- ### WhisparrV3API class declaration Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/arr-lib-whisparr.md Declares the WhisparrV3API client class extending AbstractArrAPI. Constructor takes baseUrl, apiKey, and id. valid() checks GET /api for current equals "v3"; search(int...) sends a single MoviesSearchCommand and warns when id() < 0. Deprecated since 1.1.0. ```java public class WhisparrV3API extends AbstractArrAPI { public WhisparrV3API(@NotNull String baseUrl, @NotNull String apiKey, int id); @Override public boolean valid(); @Override public @NotNull ArrType type(); // ArrType.WHISPARR @Override public @NotNull String version(); // "v3" @Override public void search(int... itemIds); @Override public String toString(); } ``` -------------------------------- ### Example — cancelling an event Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/events-base.md Shows how to cancel an event using the Cancellable interface. The commented line demonstrates checking cancellation state. ```java subscribe(SonarrPreSearchEvent.class, event -> { event.cancelled(true); // block the search batch // or: if (event.isCancelled()) ... }); ``` -------------------------------- ### setupRadarr instance registration pattern Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/app-main.md Shows the pattern for registering an app instance: reads URL and API key from config, skips if both are null, warns if only one is set, strips trailing slashes from URL, creates the API object, logs a warning if authentication fails but still registers, and logs whether registration succeeded or was cancelled. ```java private static void setupRadarr(int num) { String url = ArrConfigVars.get(ArrConfigVars.URL, ArrType.RADARR, num); String key = ArrConfigVars.get(ArrConfigVars.API_KEY, ArrType.RADARR, num); if (url == null && key == null) { return; } // ... warn if only one of url/key is set, then: url = url.strip().replaceAll("/+$", ""); key = key.strip(); RadarrV3API arrApi = new RadarrV3API(url, key, num); if (!arrApi.valid()) { LOGGER.warn("Could not authenticate to Radarr instance configured at {} ({}) - adding anyway", ...); } if (FetcharrAPIProvider.instance().updateManager().register(new RadarrUpdater(api, arrApi, num))) { LOGGER.info("Added RADARR_{} instance at {}", num, url); } else { LOGGER.info("Did not add RADARR_{} instance at {} - registration cancelled", num, url); } } ``` -------------------------------- ### plugins.yaml configuration for plugin downloads Source: https://github.com/egg82/fetcharr/blob/main/README.md Create a `/plugins.yaml` file to automatically download plugins from URLs at startup. Each item under `plugins` can be a direct download (with `url`, `filename`, and optional `sha256`) or a manifest reference (`manifest`). Manifest references can recursively reference other manifests, with loops detected and ignored. Duplicate filenames are overwritten by later entries unless the SHA256 matches. ```yaml plugins: - url: https://some.web.domain/some/path/some-plugin-1.0.0.jar filename: 01-some-plugin.jar - url: https://another.web.domain/another/path/v1.2.3/another-plugin.jar filename: 02-another-plugin.jar sha256: 396d448073cf44195508216fca8668cfd6ab395bb447a077227b17d521dec80b - manifest: https://some.web.domain/whatever/path/manifest.yaml ``` -------------------------------- ### ObjectParser usage example Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/arr-lib-parse.md Example of parsing a Ratings object from a movie JSON object using ObjectParser.get. ```java Ratings ratings = ObjectParser.get(Ratings.class, api, movieJson, "ratings"); ``` -------------------------------- ### GET /api/v1/tag Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches a list of TagResource objects. ```APIDOC ## GET /api/v1/tag ### Description Fetches a list of TagResource objects. ### Method GET ### Endpoint /api/v1/tag ### Response #### Success Response (200) - **TagResource** (object) - List of tag resources #### Response Example ```json [ { "id": 1, "label": "tag1" } ] ``` ``` -------------------------------- ### GET /api/v1/qualityprofile Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches a list of QualityProfileResource objects. ```APIDOC ## GET /api/v1/qualityprofile ### Description Fetches a list of QualityProfileResource objects. ### Method GET ### Endpoint /api/v1/qualityprofile ### Response #### Success Response (200) - **QualityProfileResource** (object) - List of quality profile resources #### Response Example ```json [ { "id": 1, "name": "HD" } ] ``` ``` -------------------------------- ### PluginManager.start() Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/plugin-system.md Calls Plugin.start() on all plugins. Guarded to run only once. ```APIDOC ## PluginManager.start() ### Description Calls `Plugin.start()` on all plugins. Guarded so it can only run once. ### Method `start()` ### Parameters None ### Returns `void` ### Example ```java FetcharrAPIProvider.instance().pluginManager().start(); ``` ``` -------------------------------- ### GET /api/v1/metadataprofile Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches a list of MetadataProfileResource objects. ```APIDOC ## GET /api/v1/metadataprofile ### Description Fetches a list of MetadataProfileResource objects. ### Method GET ### Endpoint /api/v1/metadataprofile ### Response #### Success Response (200) - **MetadataProfileResource** (object) - List of metadata profile resources #### Response Example ```json [ { "id": 1, "name": "Standard" } ] ``` ``` -------------------------------- ### PluginManager.init() Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/plugin-system.md Initializes all plugins by creating data/config directories and calling Plugin.init() on each. Guarded to run only once. ```APIDOC ## PluginManager.init() ### Description Initializes all plugins (creates data/config dirs, calls `Plugin.init()`). Guarded so it can only run once. ### Method `init()` ### Parameters None ### Returns `void` ### Example ```java FetcharrAPIProvider.instance().pluginManager().init(); ``` ``` -------------------------------- ### FetcharrAPIProvider.instance() Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/fetcharr-api.md Static singleton accessor for the FetcharrAPI instance. Returns the plugin-facing entry point of Fetcharr, registered at startup. ```APIDOC ## FetcharrAPIProvider.instance() ### Description Static singleton accessor for the FetcharrAPI instance. Returns the plugin-facing entry point of Fetcharr, registered at startup. ### Method GET ### Endpoint FetcharrAPIProvider.instance() ### Parameters None ### Response #### Success Response (200) - **FetcharrAPI** - The FetcharrAPI instance. #### Response Example ```java FetcharrAPI api = FetcharrAPIProvider.instance(); ``` ``` -------------------------------- ### GET /api/v1/tag Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches tags from Lidarr. Returns an array or object of TagResource. ```APIDOC ## [GET] /api/v1/tag ### Description Fetches tags from Lidarr. Returns an array or object of TagResource. ### Method GET ### Endpoint /api/v1/tag ### Response #### Success Response (200) - **body** (array/object) - TagResource #### Response Example ```json { "id": 1, "label": "Example" } ``` ``` -------------------------------- ### GET /api/v1/indexer Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches indexers from Lidarr. Returns an array or object of IndexerResource. ```APIDOC ## [GET] /api/v1/indexer ### Description Fetches indexers from Lidarr. Returns an array or object of IndexerResource. ### Method GET ### Endpoint /api/v1/indexer ### Response #### Success Response (200) - **body** (array/object) - IndexerResource #### Response Example ```json { "id": 1, "name": "Example Indexer" } ``` ``` -------------------------------- ### GET /api/v3/tag Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches tags from Sonarr. Returns an array or object of TagResource. ```APIDOC ## [GET] /api/v3/tag ### Description Fetches tags from Sonarr. Returns an array or object of TagResource. ### Method GET ### Endpoint /api/v3/tag ### Response #### Success Response (200) - **body** (array/object) - TagResource #### Response Example ```json { "id": 1, "label": "Example" } ``` ``` -------------------------------- ### WhisparrV3API Constructor Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/arr-lib-whisparr.md Creates a new WhisparrV3API client instance with the specified base URL, API key, and ID. ```APIDOC ## WhisparrV3API Constructor ### Description Creates a new WhisparrV3API client instance. ### Method Constructor ### Endpoint N/A (SDK constructor) ### Parameters - **baseUrl** (String) - Required - The base URL of the Whisparr instance. - **apiKey** (String) - Required - The API key for authentication. - **id** (int) - Required - The client ID. ### Request Example ```java WhisparrV3API api = new WhisparrV3API("https://whisparr.home.lab", "key", 0); ``` ### Response #### Success Response - Returns a new WhisparrV3API instance. #### Response Example ```java WhisparrV3API api = new WhisparrV3API("https://whisparr.home.lab", "key", 0); ``` ``` -------------------------------- ### GET /api/v1/releaseprofile Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches release profiles from Lidarr. Returns an array or object of ReleaseProfileResource. ```APIDOC ## [GET] /api/v1/releaseprofile ### Description Fetches release profiles from Lidarr. Returns an array or object of ReleaseProfileResource. ### Method GET ### Endpoint /api/v1/releaseprofile ### Response #### Success Response (200) - **body** (array/object) - ReleaseProfileResource #### Response Example ```json { "id": 1, "name": "Example Profile" } ``` ``` -------------------------------- ### SonarrV3API constructor Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/arr-lib-sonarr.md Creates a new SonarrV3API client instance with the specified base URL, API key, and ID. ```APIDOC ## SonarrV3API(String baseUrl, String apiKey, int id) ### Description Creates a new SonarrV3API client instance with the specified base URL, API key, and ID. ### Method Constructor ### Parameters - **baseUrl** (String) - Required - The base URL of the Sonarr instance. - **apiKey** (String) - Required - The API key for authentication. - **id** (int) - Required - The client ID. ### Request Example ```java SonarrV3API api = new SonarrV3API("https://sonarr.home.lab", "key", 1); ``` ``` -------------------------------- ### RadarrV3API Constructor Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/arr-lib-radarr.md Creates a new RadarrV3API client instance with the specified base URL, API key, and ID. ```APIDOC ## RadarrV3API Constructor ### Description Creates a new RadarrV3API client instance with the specified base URL, API key, and ID. ### Method Constructor ### Signature `public RadarrV3API(@NotNull String baseUrl, @NotNull String apiKey, int id)` ### Parameters - **baseUrl** (String) - Required - The base URL of the Radarr instance. - **apiKey** (String) - Required - The API key for authentication. - **id** (int) - Required - The ID of this API instance. ``` -------------------------------- ### GET /api/v1/qualityprofile Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches quality profiles from Lidarr. Returns an array or object of QualityProfileResource. ```APIDOC ## [GET] /api/v1/qualityprofile ### Description Fetches quality profiles from Lidarr. Returns an array or object of QualityProfileResource. ### Method GET ### Endpoint /api/v1/qualityprofile ### Response #### Success Response (200) - **body** (array/object) - QualityProfileResource #### Response Example ```json { "id": 1, "name": "HD" } ``` ``` -------------------------------- ### GET /api/v1/metadataprofile Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches metadata profiles from Lidarr. Returns an array or object of MetadataProfileResource. ```APIDOC ## [GET] /api/v1/metadataprofile ### Description Fetches metadata profiles from Lidarr. Returns an array or object of MetadataProfileResource. ### Method GET ### Endpoint /api/v1/metadataprofile ### Response #### Success Response (200) - **body** (array/object) - MetadataProfileResource #### Response Example ```json { "id": 1, "name": "Standard" } ``` ``` -------------------------------- ### LidarrV1API constructor Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/arr-lib-lidarr.md Creates a new LidarrV1API client instance with the specified base URL, API key, and ID. The ID is used for logging and identifying the client instance. ```APIDOC ## LidarrV1API Constructor ### Description Creates a new LidarrV1API client instance. ### Signature ```java public LidarrV1API(@NotNull String baseUrl, @NotNull String apiKey, int id) ``` ### Parameters - **baseUrl** (String) - Required - The base URL of the Lidarr instance. - **apiKey** (String) - Required - The API key for authentication. - **id** (int) - Required - The client ID used for logging. ``` -------------------------------- ### fetch(Command.class) Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/arr-lib-sonarr.md Fetches command resources from the Sonarr API. ```APIDOC ## fetch(Command.class) ### Description Fetches command resources from the Sonarr API. ### Method GET ### Endpoint `/api/v3/command` ### Response #### Success Response (200) - **Command** - A Command object containing a list of CommandResource objects. ``` -------------------------------- ### GET /api/v1/series Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches a list of SeriesResource objects. Note this is the Readarr SeriesResource, distinct from Sonarr's. ```APIDOC ## GET /api/v1/series ### Description Fetches a list of SeriesResource objects. Note this is the Readarr SeriesResource, distinct from Sonarr's. ### Method GET ### Endpoint /api/v1/series ### Response #### Success Response (200) - **SeriesResource** (object) - List of series resources #### Response Example ```json [ { "id": 1, "title": "Series Title" } ] ``` ``` -------------------------------- ### GET /api/v1/track Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches tracks from Lidarr, optionally filtered by artistId. Returns an array or object of TrackResource. ```APIDOC ## [GET] /api/v1/track ### Description Fetches tracks from Lidarr, optionally filtered by artistId. Returns an array or object of TrackResource. ### Method GET ### Endpoint /api/v1/track ### Parameters #### Query Parameters - **artistId** (int) - Optional - Filter tracks by artist ID ### Response #### Success Response (200) - **body** (array/object) - TrackResource #### Response Example ```json { "id": 1, "artistId": 1, "title": "Example Track" } ``` ``` -------------------------------- ### MoviesSearchCommand Constructor Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/arr-lib-whisparr.md Creates a new MoviesSearchCommand with the specified movie IDs. The command is sent to the '/api/v3/command' endpoint. ```APIDOC ## MoviesSearchCommand Constructor ### Description Creates a new MoviesSearchCommand with the specified movie IDs. ### Method POST ### Endpoint `/api/v3/command` ### Parameters - **ids** (int[]) - Required - The IDs of the movies to search for. ### Request Example ```java MoviesSearchCommand command = new MoviesSearchCommand(new int[] { 1, 2 }); ``` ### Response #### Success Response - Returns a `CommandResource` when sent via `api.send(command, CommandResource.class)`. #### Response Example ```java CommandResource result = api.send(new MoviesSearchCommand(new int[] { 1, 2 }), CommandResource.class); ``` ### Request Body ```json { "name": "MoviesSearch", "movieIds": [1, 2] } ``` ``` -------------------------------- ### GET /api/v1/album Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches albums from Lidarr, optionally filtered by artistId. Returns an array or object of AlbumResource. ```APIDOC ## [GET] /api/v1/album ### Description Fetches albums from Lidarr, optionally filtered by artistId. Returns an array or object of AlbumResource. ### Method GET ### Endpoint /api/v1/album ### Parameters #### Query Parameters - **artistId** (int) - Optional - Filter albums by artist ID ### Response #### Success Response (200) - **body** (array/object) - AlbumResource #### Response Example ```json { "id": 1, "artistId": 1, "title": "Example Album" } ``` ``` -------------------------------- ### fetch(DownloadClient.class) Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/arr-lib-lidarr.md Fetches download client resources from the Lidarr API. Returns a DownloadClient object containing a list of DownloadClientResource objects. ```APIDOC ## fetch(DownloadClient.class) ### Description Fetches download client resources from the Lidarr API. ### Endpoint `GET /api/v1/downloadclient` ### Returns - **DownloadClient** - A `DownloadClient` object with `resources()` returning `List`. ``` -------------------------------- ### GET /api/v1/author Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches a list of AuthorResource objects. Individual authors can be fetched by appending the author ID to the endpoint. ```APIDOC ## GET /api/v1/author ### Description Fetches a list of AuthorResource objects. Individual authors can be fetched by appending the author ID to the endpoint. ### Method GET ### Endpoint /api/v1/author ### Response #### Success Response (200) - **AuthorResource** (object) - List of author resources #### Response Example ```json [ { "id": 1, "name": "Author Name" } ] ``` ``` -------------------------------- ### GET /api/v1/book Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches a list of BookResource objects. Typically used with the authorId query parameter to filter books by author. ```APIDOC ## GET /api/v1/book ### Description Fetches a list of BookResource objects. Typically used with the authorId query parameter to filter books by author. ### Method GET ### Endpoint /api/v1/book ### Parameters #### Query Parameters - **authorId** (int) - Optional - Filter books by author ID ### Response #### Success Response (200) - **BookResource** (object) - List of book resources #### Response Example ```json [ { "id": 1, "title": "Book Title", "authorId": 1 } ] ``` ``` -------------------------------- ### plugin.yaml structure for Fetcharr plugins Source: https://github.com/egg82/fetcharr/blob/main/README.md Required configuration file for a Fetcharr plugin. Must include id, name, version, and class; description, authors, and exports are optional. The class must implement me.egg82.fetcharr.api.plugin.Plugin. ```yaml id: unique-id name: Some name version: Any version number description: Whatever description authors: [some, authors] class: your.package.path.MainClass exports: - another.package.path.to.api - maybe.some.path.to.Class ``` -------------------------------- ### Run Docker container with custom user (--user flag) Source: https://github.com/egg82/fetcharr/blob/main/README.md Sets the container user to 99:100 at runtime using the --user flag. Fetcharr will not change volume ownership for data directories. ```bash docker run \ --user 99:100 \ ... \ egg82/fetcharr:latest ``` -------------------------------- ### GET /api/v1/bookfile Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches a list of BookFileResource objects. Typically used with the authorId query parameter to filter book files by author. ```APIDOC ## GET /api/v1/bookfile ### Description Fetches a list of BookFileResource objects. Typically used with the authorId query parameter to filter book files by author. ### Method GET ### Endpoint /api/v1/bookfile ### Parameters #### Query Parameters - **authorId** (int) - Optional - Filter book files by author ID ### Response #### Success Response (200) - **BookFileResource** (object) - List of book file resources #### Response Example ```json [ { "id": 1, "bookId": 1, "path": "/path/to/file" } ] ``` ``` -------------------------------- ### WebhookAPIProvider.instance() Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/webhook-plugin.md Provides access to the WebhookAPI instance. Throws IllegalStateException if the API is not loaded. ```APIDOC ## [JAVA] WebhookAPIProvider.instance() ### Description Provides access to the WebhookAPI instance. Throws IllegalStateException if the API is not loaded. ### Method instance ### Signature public static @NotNull WebhookAPI instance() ### Returns - **WebhookAPI** - The WebhookAPI instance. ### Throws - **IllegalStateException** - If WebhookAPI is not loaded. ### Example ```java WebhookAPI api = WebhookAPIProvider.instance(); ``` ``` -------------------------------- ### GET /api/v1/artist Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches a list of artists from Lidarr. Returns an array or object of ArtistResource, and individual artists can be fetched by appending the ID to the endpoint. ```APIDOC ## [GET] /api/v1/artist ### Description Fetches a list of artists from Lidarr. Returns an array or object of ArtistResource, and individual artists can be fetched by appending the ID to the endpoint. ### Method GET ### Endpoint /api/v1/artist ### Response #### Success Response (200) - **body** (array/object) - ArtistResource #### Response Example ```json { "id": 1, "name": "Example Artist" } ``` ``` -------------------------------- ### version() Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/arr-lib-api.md Returns the API version string (e.g., "v3" or "v1"). ```APIDOC ## version() ### Description Returns the API version string (e.g., "v3" or "v1"). ### Method GET ### Endpoint `/api` ### Response #### Success Response (200) - **String** - The API version #### Response Example ```json "v3" ``` ``` -------------------------------- ### GET /api/v3/series Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches a list of series from Sonarr. Returns an array or object of SeriesResource, and individual series can be fetched by appending the ID to the endpoint. ```APIDOC ## [GET] /api/v3/series ### Description Fetches a list of series from Sonarr. Returns an array or object of SeriesResource, and individual series can be fetched by appending the ID to the endpoint. ### Method GET ### Endpoint /api/v3/series ### Response #### Success Response (200) - **body** (array/object) - SeriesResource #### Response Example ```json { "id": 1, "title": "Example Series" } ``` ``` -------------------------------- ### EnabledPlugin.context() Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/plugin-system.md Returns the PluginContext providing runtime context for the plugin. ```APIDOC ## EnabledPlugin.context() ### Description Returns the `PluginContext` for this enabled plugin. ### Method `context()` ### Parameters None ### Returns `@NotNull PluginContext` - plugin runtime context ### Example ```java EnabledPlugin ep = ...; PluginContext ctx = ep.context(); ``` ``` -------------------------------- ### valid() Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/arr-lib-radarr.md Checks if the API is valid by sending a GET request to the base URL and verifying the version. ```APIDOC ## valid() ### Description Checks if the API is valid by sending a GET request to the base URL and verifying the version. ### Method GET ### Endpoint `/api` ### Response #### Success Response (200) - **current** (string) - The current version of the API. Must equal `"v3"` for validity. ### Notes - If the `current` field does not match `version()` (`"v3"`), a warning is logged: `"RADARR_ returned unexpected response ..."`. ``` -------------------------------- ### version() Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/arr-lib-sonarr.md Returns the version string of this client, which is "v3". ```APIDOC ## version() ### Description Returns the version string of this client, which is "v3". ### Method GET ### Response - **String** - Always returns "v3". ``` -------------------------------- ### WebhookPayloadMethod enum Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/webhook-plugin.md Enumeration of supported HTTP methods for webhook payloads: GET, POST, PUT, PATCH, DELETE. ```java public enum WebhookPayloadMethod { GET, POST, PUT, PATCH, DELETE } ``` -------------------------------- ### getAll Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/registry.md Retrieves all objects registered under the given class key. Returns an empty PVector if none exist. ```APIDOC ## getAll ### Description Retrieves all objects registered under the given class key. Returns an empty PVector if none exist. ### Method getAll ### Signature ` PVector getAll(Class type)` ### Parameters - **type** (Class) - Required - The class key to look up. ### Returns - A PVector containing all objects registered under the class key, or an empty PVector if none. ### Example ```java PVector apis = FetcharrAPIProvider.instance().registry().getAll(MyApi.class); ``` ``` -------------------------------- ### GET /api/v3/episode Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/endpoints.md Fetches episodes from Sonarr, optionally filtered by seriesId. Returns an array or object of EpisodeResource, and individual episodes can be fetched by appending the ID to the endpoint. ```APIDOC ## [GET] /api/v3/episode ### Description Fetches episodes from Sonarr, optionally filtered by seriesId. Returns an array or object of EpisodeResource, and individual episodes can be fetched by appending the ID to the endpoint. ### Method GET ### Endpoint /api/v3/episode ### Parameters #### Query Parameters - **seriesId** (int) - Optional - Filter episodes by series ID ### Response #### Success Response (200) - **body** (array/object) - EpisodeResource #### Response Example ```json { "id": 1, "seriesId": 1, "title": "Example Episode" } ``` ``` -------------------------------- ### fetch(QualityProfile.class) Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/arr-lib-sonarr.md Fetches quality profile resources from the Sonarr API. ```APIDOC ## fetch(QualityProfile.class) ### Description Fetches quality profile resources from the Sonarr API. ### Method GET ### Endpoint `/api/v3/qualityprofile` ### Response #### Success Response (200) - **QualityProfile** - A QualityProfile object containing a list of QualityProfileResource objects. ``` -------------------------------- ### valid() Source: https://github.com/egg82/fetcharr/blob/main/_autodocs/api-reference/arr-lib-sonarr.md Checks if the Sonarr API is valid by sending a GET request to the base URL and verifying the version is 'v3'. ```APIDOC ## valid() ### Description Checks if the Sonarr API is valid by sending a GET request to the base URL and verifying the version is 'v3'. ### Method GET ### Endpoint `/api` ### Response #### Success Response (200) - **current** (String) - The current API version. Must equal "v3" for valid to return true. ### Response Example ```json { "current": "v3" } ``` ```