Skip to content
Merged
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
78 changes: 22 additions & 56 deletions Cargo.lock

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

33 changes: 19 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
[package]
name = "seadexerr"
version = "0.3.2"
version = "0.4.0"
edition = "2024"

[dependencies]
anyhow = "1.0"
axum = { version = "0.7", features = ["macros"] }
quick-xml = "0.31"
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_with = "3.11"
thiserror = "1.0"
time = { version = "0.3", features = ["formatting", "parsing"] }
tokio = { version = "1.38", features = ["fs", "macros", "rt-multi-thread", "sync", "time"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter"] }
url = "2.5"
anyhow = "1.0.100"
axum = { version = "0.8.7", features = ["macros"] }
quick-xml = "0.38.4"
reqwest = { version = "0.12.24", default-features = false, features = ["json", "rustls-tls"] }
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.145"
serde_with = "3.16.0"
thiserror = "2.0.17"
time = { version = "0.3.44", features = ["formatting", "parsing"] }
tokio = { version = "1.48.0", features = ["fs", "macros", "rt-multi-thread", "sync", "time"] }
tracing = "0.1.41"
tracing-subscriber = { version = "0.3.20", features = ["fmt", "env-filter"] }
url = "2.5.7"

[profile.release]
lto = true
codegen-units = 1
strip = true
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ services:
environment:
- SONARR_BASE_URL=http://localhost:8989/
- SONARR_API_KEY=<your api key here>
- RADARR_BASE_URL=http://localhost:7878/
- RADARR_API_KEY=<your api key here>
```

<details>
Expand All @@ -26,6 +28,9 @@ Most can be left as default
| `SONARR_API_KEY` | **(required)** | Sonarr API key used to resolve series titles for feed names. |
| `SONARR_BASE_URL` | `http://localhost:8989/` | Base URL for your Sonarr instance. |
| `SONARR_TIMEOUT_SECS` | `SEADEXER_RELEASES_TIMEOUT_SECS` (10) | Timeout (seconds) for Sonarr API requests. |
| `RADARR_API_KEY` | **(required)** | Radarr API key used to resolve movie titles. |
| `RADARR_BASE_URL` | `http://localhost:7878/` | Base URL for your Radarr instance. |
| `RADARR_TIMEOUT_SECS` | `SEADEXER_RELEASES_TIMEOUT_SECS` (10) | Timeout (seconds) for Radarr API requests. |
| `SEADEXER_ANILIST_BASE_URL` | `https://graphql.anilist.co` | GraphQL endpoint used to resolve AniList titles and formats. |
| `SEADEXER_ANILIST_TIMEOUT_SECS` | `SEADEXER_RELEASES_TIMEOUT_SECS` (10) | Timeout (seconds) for AniList GraphQL requests. |
| `SEADEXER_HOST` | `0.0.0.0` | Interface the HTTP server listens on. |
Expand Down Expand Up @@ -53,7 +58,7 @@ In Prowlarr:
4. Set **Url** to `http://seadexerr:6767`
5. Click **Test** and **Save**

In Sonarr:
In Sonarr or Radarr:

1. Go to **Settings → Custom Formats**
2. Create a new **Custom Format** named `Seadex`
Expand All @@ -65,9 +70,9 @@ In Sonarr:

## Future Plans

- [ ] Movie Support
- [ ] Specials Support
- [ ] Episode Support
- [x] Movie Support (TMDB + Radarr)
- [x] RSS Refresh
- [x] Local PlexAniBridge Mappings

Expand Down
29 changes: 5 additions & 24 deletions src/anilist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@ query MediaById($idIn: [Int], $perPage: Int) {
Page(perPage: $perPage) {
media(id_in: $idIn) {
id
type
format
title {
english
romaji
native
}
}
}
}
Expand Down Expand Up @@ -93,16 +89,8 @@ impl AniListClient {
None => continue,
};

let title = media
.title
.english
.or(media.title.romaji)
.or(media.title.native)
.unwrap_or_else(|| format!("AniList {}", media.id));

result.entry(media.id).or_insert(AniListMedia {
id: media.id,
title,
format,
});
}
Expand Down Expand Up @@ -151,7 +139,6 @@ impl MediaFormat {
#[derive(Debug, Clone)]
pub struct AniListMedia {
pub id: i64,
pub title: String,
pub format: MediaFormat,
}

Expand Down Expand Up @@ -190,15 +177,9 @@ struct GraphqlPage {
#[derive(Debug, Deserialize)]
struct GraphqlMedia {
id: i64,
#[serde(rename = "type")]
media_type: Option<String>,
format: Option<String>,
title: AniListTitle,
}

#[derive(Debug, Deserialize)]
struct AniListTitle {
english: Option<String>,
romaji: Option<String>,
native: Option<String>,
}

#[derive(Debug, Deserialize)]
Expand All @@ -208,9 +189,9 @@ struct GraphqlError {

#[derive(Debug, Error)]
pub enum AniListError {
#[error("http error when querying AniList GraphQL API")]
#[error("http error when querying AniList GraphQL API: {0}")]
Http(#[from] reqwest::Error),
#[error("failed to deserialise AniList response payload")]
#[error("failed to deserialise AniList response payload: {0}")]
Deserialisation(#[from] serde_json::Error),
#[error("AniList response missing data node")]
MissingData,
Expand Down
Loading