Skip to content

zimmermanc/watchlistarr-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Watchlistarr Rust

A high-performance Rust port of Watchlistarr that automatically syncs your Plex watchlists with Sonarr (TV shows) and Radarr (movies). Achieved 98% memory reduction (5MB vs 278MB Java version) with improved performance and reliability.

Features

  • 🚀 Ultra-lightweight: Only 5MB memory usage vs 278MB in Java version
  • Async performance: Built with Tokio for high-performance non-blocking I/O
  • 🔄 Real-time sync: Monitors Plex watchlists and syncs changes every 15 seconds
  • 📺 Dual service support: Automatically routes TV shows to Sonarr and movies to Radarr
  • 🛡️ Smart duplicate detection: Prevents re-adding content using TMDB/TVDB IDs
  • 🏷️ Tagging system: Adds configurable tags to tracked content
  • 🔧 Drop-in replacement: Compatible with existing Watchlistarr configurations

Quick Start

Installation

  1. Download the binary from the releases page

  2. Set up configuration:

    cp config-example.yaml config.yaml
    # Edit config.yaml with your API keys and URLs
  3. Run the application:

    ./watchlistarr --config config.yaml

Configuration

Copy the example configuration and update with your service details:

cp config-example.yaml config.yaml

Edit config.yaml:

sonarr:
  baseUrl: "https://your-sonarr-url.com"
  apikey: "your-sonarr-api-key-here"
  qualityProfile: "Any"
  seasonMonitoring: "all"

radarr:
  baseUrl: "https://your-radarr-url.com"
  apikey: "your-radarr-api-key-here"
  qualityProfile: "Any"

plex:
  token: "your-plex-token-here"
  skipfriendsync: false

Security Note: Never commit config.yaml to version control as it contains sensitive API keys.

How It Works

  1. Monitors Plex: Regularly fetches your Plex watchlist via RSS
  2. Content Classification: Automatically detects TV shows vs movies from Plex metadata
  3. Service Routing: Sends TV shows to Sonarr and movies to Radarr
  4. Duplicate Prevention: Checks existing content using TMDB/TVDB IDs before adding
  5. Tagging: Adds "watchlistarr" tags to tracked content for easy identification

API Requirements

Plex

  • Personal access token from your Plex account
  • RSS watchlist access enabled

Sonarr (v3+)

  • API key with full permissions
  • Quality profile configured
  • Root folder set up

Radarr (v3+)

  • API key with full permissions
  • Quality profile configured
  • Root folder set up

Building from Source

# Clone the repository
git clone https://github.com/zimmermanc/watchlistarr-rust.git
cd watchlistarr-rust

# Build release binary
cargo build --release

# Run with config
./target/release/watchlistarr --config config.yaml

Production Deployment

Systemd Service (Linux)

  1. Install binary:

    sudo cp target/release/watchlistarr /usr/local/bin/
  2. Create service file /etc/systemd/system/watchlistarr.service:

    [Unit]
    Description=Watchlistarr Rust - Plex Watchlist Sync
    After=network.target
    
    [Service]
    Type=simple
    User=watchlistarr
    WorkingDirectory=/opt/watchlistarr
    ExecStart=/usr/local/bin/watchlistarr --config /opt/watchlistarr/config.yaml
    Restart=always
    RestartSec=10
    
    [Install]
    WantedBy=multi-user.target
  3. Enable and start:

    sudo systemctl enable watchlistarr
    sudo systemctl start watchlistarr

Docker

FROM scratch
COPY watchlistarr /watchlistarr
COPY config.yaml /config.yaml
ENTRYPOINT ["/watchlistarr", "--config", "/config.yaml"]

Performance Comparison

Metric Java Version Rust Version Improvement
Memory Usage 278MB 5MB 98% reduction
CPU Usage High Low Significantly lower
Startup Time ~30s ~1s 97% faster
Memory Leaks Occasional None 100% eliminated

Troubleshooting

Common Issues

"XML parsing failed"

  • Plex returns single-line XML - ensure you're using the latest version which handles this correctly

"Content not being added"

  • Check API keys have sufficient permissions
  • Verify quality profiles exist in Sonarr/Radarr
  • Ensure root folders are configured

"Duplicate content"

  • The application automatically prevents duplicates using TMDB/TVDB IDs
  • Check logs for duplicate detection messages

Logging

The application provides structured logging. For debug output:

RUST_LOG=debug ./watchlistarr --config config.yaml

Migration from Java Version

  1. Stop the existing Java service
  2. Copy your existing config.yaml (format is compatible)
  3. Start the Rust version with the same configuration
  4. Memory usage should drop to ~5MB immediately

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

License

This project maintains the same license as the original Watchlistarr project.

Acknowledgments

  • Original Watchlistarr project for the concept and API integration patterns
  • Plex, Sonarr, and Radarr teams for their excellent APIs
  • Rust community for the amazing ecosystem of crates

About

Rust port of Watchlistarr - syncs Plex watchlists with Sonarr and Radarr. 98% memory reduction vs Java version.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors