Skip to content

Commit

Permalink
allow base endpoints in the URL (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
nylonee authored Nov 13, 2023
1 parent 2aa9706 commit 9e4aa95
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 31 deletions.
53 changes: 30 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,20 @@ Sync plex watchlists in realtime with Sonarr and Radarr. **Requires Plex Pass**
**Requires Sonarr v4**

## Why?

### Sonarr/Radarr limitation
While Sonarr and Radarr have built-in functionality (in v4 and v3 respectively), they are set at 6 hour refresh intervals, and cannot be customized

While Sonarr and Radarr have built-in functionality (in v4 and v3 respectively), they are set at 6 hour refresh
intervals, and cannot be customized

### Ombi/Overseer limitation

While Ombi and Overseer have built-in functionality, there are two problems with this:
* They are customizable down to 5 minute intervals, so doesn't allow the "real-time" sync that Watchlistarr does
* They rely on Plex tokens, which expire and break the sync if you're not regularly logging into Ombi/Overseer
* They can only sync the current user's watchlist. If you have friends you've added to your Plex server, you won't be able to sync their watchlist

* They are customizable down to 5 minute intervals, so doesn't allow the "real-time" sync that Watchlistarr does
* They rely on Plex tokens, which expire and break the sync if you're not regularly logging into Ombi/Overseer
* They can only sync the current user's watchlist. If you have friends you've added to your Plex server, you won't be
able to sync their watchlist

## Getting Started

Expand All @@ -29,25 +35,26 @@ docker run \
```

Docker tag options:
* `latest` - Stable version, follows the Releases
* `beta` - Beta version, follows the main branch
* `alpha` - Experimental version, follows the latest successful PR build

| Key | Example Value | Optional | Description |
|--------------------------|----------------------------------|----------|--------------------------------------------------------------------------|
| REFRESH_INTERVAL_SECONDS | 60 | Yes | Number of seconds to wait in between checking the watchlist |
| SONARR_API_KEY | 7a392fb4817a46e59f2e84e7d5f021bc | No | API key for Sonarr, found in your Sonarr UI -> General settings |
| SONARR_BASE_URL | http://localhost:8989 | Yes | Base URL for Sonarr, including the 'http' and port |
| SONARR_QUALITY_PROFILE | 1080p | Yes | Quality profile for Sonarr, found in your Sonarr UI -> Profiles settings |
| SONARR_ROOT_FOLDER | /data/ | Yes | Root folder for Sonarr |
| SONARR_BYPASS_IGNORED | true | Yes | Boolean flag to bypass tv shows that are on the Sonarr Exclusion List |
| RADARR_API_KEY | 7a392fb4817a46e59f2e84e7d5f021bc | No | API key for Radarr, found in your Radarr UI -> General settings |
| RADARR_BASE_URL | http://127.0.0.1:7878 | Yes | Base URL for Radarr, including the 'http' and port |
| RADARR_QUALITY_PROFILE | 1080p | Yes | Quality profile for Radarr, found in your Radarr UI -> Profiles settings |
| RADARR_ROOT_FOLDER | /data/ | Yes | Root folder for Radarr |
| RADARR_BYPASS_IGNORED | true | Yes | Boolean flag to bypass movies that are on the Radarr Exclusion List |
| PLEX_WATCHLIST_URL_1 | https://rss.plex.tv/UUID | No | First Plex Watchlist URL |
| PLEX_WATCHLIST_URL_2 | https://rss.plex.tv/UUID | Yes | Second Plex Watchlist URL (if applicable) |

* `latest` - Stable version, follows the Releases
* `beta` - Beta version, follows the main branch
* `alpha` - Experimental version, follows the latest successful PR build

| Key | Example Value | Optional | Description |
|--------------------------|----------------------------------|----------|-------------------------------------------------------------------------------|
| REFRESH_INTERVAL_SECONDS | 60 | Yes | Number of seconds to wait in between checking the watchlist |
| SONARR_API_KEY | 7a392fb4817a46e59f2e84e7d5f021bc | No | API key for Sonarr, found in your Sonarr UI -> General settings |
| SONARR_BASE_URL | http://localhost:8989 | Yes | Base URL for Sonarr, including the 'http' and port and any configured urlbase |
| SONARR_QUALITY_PROFILE | 1080p | Yes | Quality profile for Sonarr, found in your Sonarr UI -> Profiles settings |
| SONARR_ROOT_FOLDER | /data/ | Yes | Root folder for Sonarr |
| SONARR_BYPASS_IGNORED | true | Yes | Boolean flag to bypass tv shows that are on the Sonarr Exclusion List |
| RADARR_API_KEY | 7a392fb4817a46e59f2e84e7d5f021bc | No | API key for Radarr, found in your Radarr UI -> General settings |
| RADARR_BASE_URL | http://127.0.0.1:7878 | Yes | Base URL for Radarr, including the 'http' and port and any configured urlbase |
| RADARR_QUALITY_PROFILE | 1080p | Yes | Quality profile for Radarr, found in your Radarr UI -> Profiles settings |
| RADARR_ROOT_FOLDER | /data/ | Yes | Root folder for Radarr |
| RADARR_BYPASS_IGNORED | true | Yes | Boolean flag to bypass movies that are on the Radarr Exclusion List |
| PLEX_WATCHLIST_URL_1 | https://rss.plex.tv/UUID | No | First Plex Watchlist URL |
| PLEX_WATCHLIST_URL_2 | https://rss.plex.tv/UUID | Yes | Second Plex Watchlist URL (if applicable) |

### Getting your Plex Watchlist URLs

Expand Down
12 changes: 4 additions & 8 deletions src/main/scala/utils/ArrUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@ import org.http4s.{Method, Uri}

object ArrUtils {

def getToArr(client: HttpClient)(baseUrl: Uri, apiKey: String, endpoint: String): IO[Either[Throwable, Json]] = {
val path = Uri.Path.unsafeFromString(s"/api/v3/$endpoint")
client.httpRequest(Method.GET, baseUrl.withPath(path), Some(apiKey))
}
def getToArr(client: HttpClient)(baseUrl: Uri, apiKey: String, endpoint: String): IO[Either[Throwable, Json]] =
client.httpRequest(Method.GET, baseUrl / "api" / "v3" / endpoint, Some(apiKey))

def postToArr(client: HttpClient)(baseUrl: Uri, apiKey: String, endpoint: String)(payload: Json): IO[Either[Throwable, Json]] = {
val path = Uri.Path.unsafeFromString(s"/api/v3/$endpoint")
client.httpRequest(Method.POST, baseUrl.withPath(path), Some(apiKey), Some(payload))
}
def postToArr(client: HttpClient)(baseUrl: Uri, apiKey: String, endpoint: String)(payload: Json): IO[Either[Throwable, Json]] =
client.httpRequest(Method.POST, baseUrl / "api" / "v3" / endpoint, Some(apiKey), Some(payload))

}

0 comments on commit 9e4aa95

Please sign in to comment.