### Deploy Fetcharr with Docker Compose Source: https://context7.com/egg82/fetcharr/llms.txt Deploy Fetcharr using Docker Compose for simplified configuration management and orchestration. This example includes environment variables for multiple *arr instances and persistent storage volumes. ```yaml 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 - LIDARR_0_URL=https://lidarr.home.lab - LIDARR_0_API_KEY=abc123def456ghi789 - READARR_0_URL=https://readarr.home.lab - READARR_0_API_KEY=xyz987wvu654tsr321 - MONITORED_ONLY=true - MISSING_STATUS=any - USE_CUTOFF=false volumes: - ./config:/app/config - ./cache:/app/cache - ./logs:/app/logs - ./plugins:/app/plugins restart: unless-stopped ``` -------------------------------- ### Add Fetcharr API Gradle Dependencies Source: https://context7.com/egg82/fetcharr/llms.txt Configure your Gradle project to include the Fetcharr API and arr-lib dependencies using the provided repository URL. This setup is for plugin development. ```kotlin repositories { maven { name = "egg82Releases" url = uri("https://repo.egg82.me/releases/") } } dependencies { compileOnly("me.egg82:fetcharr-api:2.2.0") compileOnly("me.egg82:arr-lib:1.1.0") } tasks.jar { archiveBaseName.set("my-plugin") archiveVersion.set("1.0.0") } ``` -------------------------------- ### Implement Registry API for Inter-Plugin Communication in Java Source: https://context7.com/egg82/fetcharr/llms.txt Demonstrates how to expose and consume custom APIs between plugins using Fetcharr's Registry API. Includes defining an API interface, implementing it, registering it with the registry, and retrieving it in another plugin. ```java package com.example.myplugin; import me.egg82.fetcharr.api.FetcharrAPIProvider; import me.egg82.fetcharr.api.model.registry.Registry; import me.egg82.fetcharr.api.plugin.Plugin; import me.egg82.fetcharr.api.plugin.PluginContext; import org.jetbrains.annotations.NotNull; // Define an API interface to expose public interface MyPluginAPI { void doSomething(String input); String getStatus(); } // Implementation public class MyPluginAPIImpl implements MyPluginAPI { @Override public void doSomething(String input) { System.out.println("Processing: " + input); } @Override public String getStatus() { return "running"; } } // Plugin that registers the API public class MyProviderPlugin implements Plugin { private MyPluginAPI api; @Override public void init(@NotNull PluginContext context) throws Exception { api = new MyPluginAPIImpl(); // Register API for other plugins to consume Registry registry = FetcharrAPIProvider.instance().registry(); registry.register(this, MyPluginAPI.class, api); } @Override public void start() throws Exception { } @Override public void stop() throws Exception { // Unregister on shutdown FetcharrAPIProvider.instance().registry().unregisterAll(this); } } // Plugin that consumes the API public class MyConsumerPlugin implements Plugin { @Override public void init(@NotNull PluginContext context) throws Exception { Registry registry = FetcharrAPIProvider.instance().registry(); // Get single API instance MyPluginAPI api = registry.getFirst(MyPluginAPI.class); if (api != null) { api.doSomething("hello"); System.out.println("Status: " + api.getStatus()); } // Get all registered instances of an API type var allApis = registry.getAll(MyPluginAPI.class); for (MyPluginAPI a : allApis) { a.doSomething("broadcast"); } } @Override public void start() throws Exception { } @Override public void stop() throws Exception { } } ``` -------------------------------- ### Configure dependencies for Gradle Source: https://github.com/egg82/fetcharr/blob/main/README.md Add the required repositories and dependencies to your build.gradle.kts file. ```kotlin repositories { maven { name = "egg82Releases" url = uri("https://repo.egg82.me/releases/") } } dependencies { compileOnly("me.egg82:fetcharr-api:API-VERSION") compileOnly("me.egg82:arr-lib:LIB-VERSION") } ``` -------------------------------- ### Per-Instance Configuration Overrides Source: https://context7.com/egg82/fetcharr/llms.txt Configure individual *arr instances with specific search parameters using numbered environment variables (0-99). This allows for fine-tuning search behavior for different libraries or types of media. ```bash # Global defaults SEARCH_AMOUNT=5 SEARCH_INTERVAL=1hour MONITORED_ONLY=true MISSING_STATUS=any USE_CUTOFF=false # Radarr instance 0 - Main movies library RADARR_0_URL=https://radarr.home.lab RADARR_0_API_KEY=e8ea891d72ff973fa6db0d34369a60a7 RADARR_0_SEARCH_AMOUNT=10 RADARR_0_SEARCH_INTERVAL=30minutes RADARR_0_MISSING_STATUS=upgrade RADARR_0_USE_CUTOFF=true RADARR_0_SKIP_TAGS=no-upgrade,archive # Radarr instance 1 - 4K library with different settings RADARR_1_URL=https://radarr4k.home.lab RADARR_1_API_KEY=f9fb902e83gg084gb7eb1e45480b71b8 RADARR_1_SEARCH_AMOUNT=3 RADARR_1_SEARCH_INTERVAL=2hours RADARR_1_MISSING_STATUS=missing # Sonarr instance 0 - TV shows SONARR_0_URL=https://sonarr.home.lab SONARR_0_API_KEY=71730b5dfaa4293fe0c050844c10df66 SONARR_0_MONITORED_ONLY=true SONARR_0_SKIP_TAGS=completed,no-search ``` -------------------------------- ### Basic Fetcharr Plugin Structure in Java Source: https://context7.com/egg82/fetcharr/llms.txt Implement the 'Plugin' interface to create a custom Fetcharr plugin. The 'init' method provides access to plugin-specific directories and files. Ensure your plugin class is correctly referenced in 'plugin.yaml'. ```java package com.example.myplugin; import me.egg82.fetcharr.api.FetcharrAPIProvider; import me.egg82.fetcharr.api.plugin.Plugin; import me.egg82.fetcharr.api.plugin.PluginContext; import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class MyPlugin implements Plugin { private final Logger logger = LoggerFactory.getLogger(getClass()); @Override public void init(@NotNull PluginContext context) throws Exception { // Access plugin-specific directories File dataDir = context.dataDir(); File configDir = context.configDir(); File jarFile = context.pluginJarFile(); logger.info("Plugin initialized with data dir: {}", dataDir.getAbsolutePath()); } @Override public void start() throws Exception { logger.info("Plugin started"); } @Override public void stop() throws Exception { logger.info("Plugin stopped"); } } ``` -------------------------------- ### Fetcharr Plugin Configuration YAML Source: https://github.com/egg82/fetcharr/blob/main/README.md Use this YAML structure in `/plugins.yaml` to automatically download plugins from specified URLs at startup. It supports direct plugin downloads with optional SHA256 verification and manifest references for nested plugin lists. ```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 ``` -------------------------------- ### Configure dependencies for Maven Source: https://github.com/egg82/fetcharr/blob/main/README.md Add the required repositories and dependencies to your pom.xml file. ```xml egg82-repo-releases https://repo.egg82.me/releases/ me.egg82 fetcharr-api API-VERSION provided me.egg82 arr-lib LIB-VERSION provided ``` -------------------------------- ### Configure Plugins in plugins.yaml Source: https://context7.com/egg82/fetcharr/llms.txt Define plugins to be downloaded and loaded by Fetcharr. Supports direct URL downloads with optional SHA256 checksums or references to external plugin manifests. ```yaml plugins: # Direct plugin download with optional SHA256 verification - url: https://github.com/user/fetcharr-custom-plugin/releases/download/v1.0.0/custom-plugin.jar filename: 01-custom-plugin.jar sha256: 396d448073cf44195508216fca8668cfd6ab395bb447a077227b17d521dec80b # Plugin from another source - url: https://example.com/plugins/another-plugin-2.0.0.jar filename: 02-another-plugin.jar # Reference to external manifest (supports recursion) - manifest: https://example.com/fetcharr-plugins/manifest.yaml ``` -------------------------------- ### Define plugin configuration in plugin.yaml Source: https://github.com/egg82/fetcharr/blob/main/README.md The plugin.yaml file is required for all plugins and must define the main class and plugin metadata. ```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 Fetcharr with Docker Source: https://github.com/egg82/fetcharr/blob/main/README.md Use this command to run Fetcharr in a Docker container. Ensure to set environment variables for configuration and mount volumes for data persistence. ```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 ``` -------------------------------- ### Deploy Fetcharr with Kubernetes Source: https://github.com/egg82/fetcharr/blob/main/README.md Kubernetes configuration for deploying Fetcharr, including namespace, persistent volume claims for storage, and a deployment manifest with container specifications and environment variables. ```yaml apiVersion: v1 kind: Namespace metadata: name: fetcharr --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: config namespace: fetcharr spec: accessModes: - ReadWriteMany resources: requests: storage: 1Gi --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: cache namespace: fetcharr spec: accessModes: - ReadWriteMany resources: requests: storage: 5Gi --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: logs namespace: fetcharr spec: accessModes: - ReadWriteMany resources: requests: storage: 10Gi --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: plugins namespace: fetcharr spec: accessModes: - ReadWriteMany resources: requests: storage: 5Gi --- apiVersion: apps/v1 kind: Deployment metadata: labels: app.kubernetes.io/name: fetcharr name: fetcharr namespace: fetcharr spec: replicas: 1 selector: matchLabels: app.kubernetes.io/name: fetcharr template: metadata: labels: app.kubernetes.io/name: fetcharr spec: securityContext: fsGroup: 1000 fsGroupChangePolicy: OnRootMismatch seccompProfile: type: RuntimeDefault containers: - image: egg82/fetcharr: name: fetcharr securityContext: runAsUser: 1000 runAsGroup: 1000 allowPrivilegeEscalation: false runAsNonRoot: true capabilities: drop: ["ALL"] resources: requests: cpu: 50m memory: 150Mi limits: cpu: 500m memory: 1Gi env: - name: VERIFY_CERTS value: "true" - name: SSL_PATH value: /etc/ssl/certs/ca-bundle.crt - name: SEARCH_AMOUNT value: "5" - name: SEARCH_INTERVAL value: 1hour - name: RADARR_0_URL value: https://radarr.home.lab - name: RADARR_0_API_KEY value: e8ea891d72ff973fa6db0d34369a60a7 - name: SONARR_0_URL value: https://sonarr.home.lab - name: SONARR_0_API_KEY value: 71730b5dfaa4293fe0c050844c10df66 - name: SONARR_1_URL value: https://anime.home.lab - name: SONARR_1_API_KEY value: bdb84dc8e4b787c76be8aae2dfe9bd19 volumeMounts: - mountPath: /app/config name: config - mountPath: /app/cache name: cache - mountPath: /app/logs name: logs - mountPath: /app/plugins name: plugins volumes: - name: config persistentVolumeClaim: claimName: config - name: cache persistentVolumeClaim: claimName: cache - name: logs persistentVolumeClaim: claimName: logs - name: plugins persistentVolumeClaim: claimName: plugins ``` -------------------------------- ### Deploy Fetcharr with Docker Compose Source: https://github.com/egg82/fetcharr/blob/main/README.md This Docker Compose configuration defines the Fetcharr service, including its image, container name, environment variables, and volume mappings for persistent data. ```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 ``` -------------------------------- ### Plugin Descriptor File (plugin.yaml) Source: https://context7.com/egg82/fetcharr/llms.txt Define metadata for your custom Fetcharr plugin, including its ID, name, version, authors, main class, and any exported packages. This file is essential for Fetcharr to load and recognize your plugin. ```yaml # src/main/resources/plugin.yaml id: my-custom-plugin name: My Custom Plugin version: 1.0.0 description: A custom Fetcharr plugin example authors: [your-name] class: com.example.myplugin.MyPlugin exports: - com.example.myplugin.api ``` -------------------------------- ### Subscribe to Fetcharr Events in Java Source: https://context7.com/egg82/fetcharr/llms.txt Implements the Plugin interface to register event listeners for Radarr and Sonarr operations. Use EventConfig to define priority and cancellation behavior for event subscriptions. ```java package com.example.myplugin; 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.*; import me.egg82.fetcharr.api.event.update.sonarr.*; import me.egg82.fetcharr.api.plugin.Plugin; import me.egg82.fetcharr.api.plugin.PluginContext; import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class EventListenerPlugin implements Plugin { private final Logger logger = LoggerFactory.getLogger(getClass()); @Override public void init(@NotNull PluginContext context) throws Exception { var events = FetcharrAPIProvider.instance().events(); // Subscribe to all Fetcharr events with lowest priority events.subscribe(FetcharrEvent.class, EventConfig.of(Integer.MAX_VALUE, false, false), this::onAnyEvent); // Subscribe to specific Radarr events events.subscribe(RadarrSelectMovieEvent.class, this::onRadarrSelect); events.subscribe(RadarrPreSearchEvent.class, this::onRadarrPreSearch); events.subscribe(RadarrPostSearchEvent.class, this::onRadarrPostSearch); // Subscribe to Sonarr events events.subscribe(SonarrSelectSeriesEvent.class, this::onSonarrSelect); } private void onAnyEvent(@NotNull FetcharrEvent event) { logger.debug("Received event: {}", event.eventType().getSimpleName()); } private void onRadarrSelect(@NotNull RadarrSelectMovieEvent event) { var movie = event.resource(); logger.info("Radarr selected movie: {} ({})", movie.title(), movie.year()); // Cancel selection if needed // event.cancelled(true); } private void onRadarrPreSearch(@NotNull RadarrPreSearchEvent event) { var movies = event.resources(); logger.info("Radarr about to search {} movies", movies.size()); // Modify the search list before submission // event.resources(filteredList); } private void onRadarrPostSearch(@NotNull RadarrPostSearchEvent event) { var result = event.result(); logger.info("Radarr search completed with status: {}", result.status()); } private void onSonarrSelect(@NotNull SonarrSelectSeriesEvent event) { var series = event.resource(); logger.info("Sonarr selected series: {}", series.title()); } @Override public void start() throws Exception { } @Override public void stop() throws Exception { } } ``` -------------------------------- ### Add Fetcharr API Maven Dependencies Source: https://context7.com/egg82/fetcharr/llms.txt Configure your Maven project to include the necessary Fetcharr API and arr-lib dependencies for plugin development. Ensure the correct repository is added. ```xml egg82-repo-releases https://repo.egg82.me/releases/ me.egg82 fetcharr-api 2.2.0 provided me.egg82 arr-lib 1.1.0 provided org.apache.maven.plugins maven-shade-plugin 3.5.0 package shade ``` -------------------------------- ### Configure Notifiarr Webhook Alerts Source: https://context7.com/egg82/fetcharr/llms.txt Configure the webhook plugin to send alerts to Notifiarr. This requires enabling the plugin, specifying the 'notifiarr' type, providing your API key and channel ID, and defining which events should trigger notifications. ```yaml webhooks: notifiarr-alerts: enabled: true type: notifiarr url: https://notifiarr.com/api/v1/notification/passthrough/ api-key: your-notifiarr-passthrough-key channel-id: 123456789012345678 events: search: true update: true skip: true ping: user-id: 987654321098765432 role-id: 0 ``` -------------------------------- ### Dry Run Mode for Testing Source: https://context7.com/egg82/fetcharr/llms.txt Enable dry-run mode to test Fetcharr configuration without triggering actual searches. This logs the intended search actions, useful for debugging and verifying settings. Set LOG_MODE to 'debug' for detailed output. ```bash docker run \ -e DRY_RUN=true \ -e LOG_MODE=debug \ -e RADARR_0_URL=https://radarr.home.lab \ -e RADARR_0_API_KEY=e8ea891d72ff973fa6db0d34369a60a7 \ -v ./logs:/app/logs \ egg82/fetcharr:latest ``` -------------------------------- ### Configure Discord Webhook Notifications Source: https://context7.com/egg82/fetcharr/llms.txt Set up the webhook plugin to send notifications to Discord for specific events like searches and updates. Ensure the 'discord-notifications' section is enabled and configured with the correct URL and event triggers. ```yaml webhooks: discord-notifications: enabled: true type: discord url: https://discord.com/api/webhooks/1234567890/abcdefghijklmnop events: search: true update: true skip: false ``` -------------------------------- ### Kubernetes Deployment for Fetcharr Source: https://context7.com/egg82/fetcharr/llms.txt This Kubernetes deployment defines a Fetcharr service with persistent volume claims for configuration and cache. It specifies resource requests and limits, security contexts, and environment variables for configuration. Ensure you have a Kubernetes cluster and the 'arr-credentials' secret configured. ```yaml apiVersion: v1 kind: Namespace metadata: name: fetcharr --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: config namespace: fetcharr spec: accessModes: - ReadWriteMany resources: requests: storage: 1Gi --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: cache namespace: fetcharr spec: accessModes: - ReadWriteMany resources: requests: storage: 5Gi --- apiVersion: apps/v1 kind: Deployment metadata: labels: app.kubernetes.io/name: fetcharr name: fetcharr namespace: fetcharr spec: replicas: 1 selector: matchLabels: app.kubernetes.io/name: fetcharr template: metadata: labels: app.kubernetes.io/name: fetcharr spec: securityContext: fsGroup: 1000 fsGroupChangePolicy: OnRootMismatch seccompProfile: type: RuntimeDefault containers: - image: egg82/fetcharr:2.2.0 name: fetcharr securityContext: runAsUser: 1000 runAsGroup: 1000 allowPrivilegeEscalation: false runAsNonRoot: true capabilities: drop: ["ALL"] resources: requests: cpu: 50m memory: 150Mi limits: cpu: 500m memory: 1Gi env: - name: SEARCH_AMOUNT value: "5" - name: SEARCH_INTERVAL value: 1hour - name: RADARR_0_URL value: https://radarr.home.lab - name: RADARR_0_API_KEY valueFrom: secretKeyRef: name: arr-credentials key: radarr-api-key volumeMounts: - mountPath: /app/config name: config - mountPath: /app/cache name: cache volumes: - name: config persistentVolumeClaim: claimName: config - name: cache persistentVolumeClaim: claimName: cache ``` -------------------------------- ### Cache Configuration Options Source: https://context7.com/egg82/fetcharr/llms.txt Configure Fetcharr's caching behavior to optimize API calls and memory usage. Options include auto-detection, forcing file-based or in-memory caching, or disabling caching entirely for debugging. ```bash # Auto-detect caching (default behavior) USE_FILE_CACHE=auto USE_MEMORY_CACHE=auto SHORT_CACHE_TIME=65minutes LONG_CACHE_TIME=6hours # Force file-based caching only (recommended for persistent deployments) USE_FILE_CACHE=true USE_MEMORY_CACHE=false # Force in-memory caching only (cache lost on restart) USE_FILE_CACHE=false USE_MEMORY_CACHE=true # Disable all caching (more API calls, useful for debugging) USE_FILE_CACHE=false USE_MEMORY_CACHE=false ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.