Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = ["doplarr", "radarr_api", "sonarr_api", "seerr_api"]
members = ["doplarr", "radarr_api", "sonarr_api", "seerr_api", "sportarr_api"]
resolver = "3"

[workspace.package]
Expand Down
24 changes: 24 additions & 0 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,27 @@ api_key = "your_sonarr_api_key"
# url = "http://localhost:5055"
# api_key = "your_seerr_admin_api_key"
# media_filter = "tv"

# ------------------------------------------------------------------------------
# SPORTARR BACKEND (Sports leagues)
# ------------------------------------------------------------------------------
# Adds a /request sport command: users search the Sportarr league catalog
# and requested leagues are added monitored, so new events get grabbed as
# they air.

# [[backends]]
# media = "sport"
#
# [backends.config.Sportarr]
# url = "http://localhost:1867"
# api_key = "your_sportarr_api_key"

# All settings below are OPTIONAL
# If omitted, users will select them at runtime via Discord UI

# Quality profile name (must match exactly what's in Sportarr)
# quality_profile = "WEB-1080p"

# Note: root folder and monitoring scope follow Sportarr's own defaults
# (per-root-folder default profiles and the league's Future monitor type),
# so those are never asked in Discord.
1 change: 1 addition & 0 deletions doplarr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ async-trait = "0.1"
# Backend APIs
radarr_api = { path = "../radarr_api" }
sonarr_api = { path = "../sonarr_api" }
sportarr_api = { path = "../sportarr_api" }
seerr_api = { path = "../seerr_api" }

# Discord libraries
Expand Down
15 changes: 15 additions & 0 deletions doplarr/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ pub enum BackendConfig {
/// Offer an "All Seasons" option in the season picker (default: true)
allow_all_seasons: Option<bool>,
},
Sportarr {
url: String,
api_key: String,
/// Pin every request to this quality profile by name; when absent, the
/// requester picks from a dropdown
quality_profile: Option<String>,
},
}

/// Starter config written when no config file exists and no migration
Expand Down Expand Up @@ -100,6 +107,14 @@ discord_token = "your_discord_bot_token"
# [backends.config.Radarr]
# url = "http://localhost:7878"
# api_key = "${RADARR_API_KEY}"

# --- Sportarr ---
# [[backends]]
# media = "sport"
#
# [backends.config.Sportarr]
# url = "http://localhost:1867"
# api_key = "${SPORTARR_API_KEY}"
"#;

/// Expand `${VAR}` references against the process environment. Expansion
Expand Down
4 changes: 4 additions & 0 deletions doplarr/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use config::{Backend, BackendConfig};
use discord::InteractionContinue;
use providers::{
MediaBackend, UserFacingError, radarr::Radarr, seerr::Seerr as SeerrBackend, sonarr::Sonarr,
sportarr::Sportarr,
};
use std::{
collections::{HashMap, HashSet},
Expand Down Expand Up @@ -114,6 +115,9 @@ async fn main() -> anyhow::Result<()> {
BackendConfig::Seerr { .. } => {
Arc::new(SeerrBackend::connect(config.clone(), backend_http.clone()).await?)
}
BackendConfig::Sportarr { .. } => {
Arc::new(Sportarr::connect(config.clone(), backend_http.clone()).await?)
}
};
backends.insert(media.as_str(), backend);
}
Expand Down
1 change: 1 addition & 0 deletions doplarr/src/providers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ mod api_logging;
pub mod radarr;
pub mod seerr;
pub mod sonarr;
pub mod sportarr;

/// Sentinel id for an "All Seasons" entry in a season multi-select. Real season
/// numbers are >= 0, so -1 never collides. The Discord layer treats an option
Expand Down
Loading