Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add experimental support for readarr #109

Merged
merged 2 commits into from
Nov 17, 2024
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
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ Other projects:
- Provide CFs directly in config (Convert JSON with https://www.bairesdev.com/tools/json2yaml/)
- Merge order is `TrashGuide -> LocalFiles -> CFs in Config`

### Supported \*arr Applications

- Radarr
- Sonarr
- Whisparr (experimental)
- Readarr (experimental)

## Configuration

Full documentation can be found here: https://configarr.raydak.de
Expand Down
28 changes: 3 additions & 25 deletions docs/docs/configuration/config-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,32 +162,10 @@ radarr:
min_format_score: 200

# experimental support: check https://configarr.rayak.de/docs/configuration/experimental-support
whisparr:
instance1: # Instance name (can be any unique identifier)
base_url: http://whisparr:6969 # instance URL
api_key: !secret WHISPARR_API_KEY # Reference to API key in secrets.yml

quality_definition:
type: movies # TODO: not checked yet

include:
# only custom defined templates available
- template: whisparr

custom_formats: # Custom format assignments
- trash_ids:
- example-in-config-cf
assign_scores_to:
- name: ExampleProfile
score: 1000
whisparr: {}

quality_profiles:
# TODO: language not correctly mapped
- name: ExampleProfile
upgrade:
until_score: 200
# Not supported in whisparr
#min_format_score: 200
# experimental support: check https://configarr.rayak.de/docs/configuration/experimental-support
readarr: {}
```

### secrets.yml
Expand Down
119 changes: 118 additions & 1 deletion docs/docs/configuration/experimental-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sidebar_position: 2
title: Experimental Support
description: "Experimental and testing support for other *Arr tools"
keywords: [configarr configuration, yaml config, custom formats, expermintal, whisparr]
keywords: [configarr configuration, yaml config, custom formats, expermintal, whisparr, readarr]
---

# Experimental support
Expand All @@ -29,3 +29,120 @@ Following things are currently not supported or tested:
```
- initial language of quality profiles is not correct -> `0`
- no available presets because nothings provided in trash guide or recyclarr -> needs to be done manually with local templates and custom formats

### Configuration File

Check [configuration file reference](/docs/configuration/config-file#custom-format-definitions) for more information.

```yaml title="config.yml"
localCustomFormatsPath: /app/cfs
localConfigTemplatesPath: /app/templates

customFormatDefinitions:
- trash_id: example-in-config-cf
trash_scores:
default: -10000
trash_description: "Language: German Only"
name: "Language: Not German"
includeCustomFormatWhenRenaming: false
specifications:
- name: Not German Language
implementation: LanguageSpecification
negate: true
required: false
fields:
value: 4

# experimental support: check https://configarr.rayak.de/docs/configuration/experimental-support
whisparr:
instance1: # Instance name (can be any unique identifier)
base_url: http://whisparr:6969 # instance URL
api_key: !secret WHISPARR_API_KEY # Reference to API key in secrets.yml

quality_definition:
type: movies # TODO: not checked yet

include:
# only custom defined templates available
- template: whisparr

custom_formats: # Custom format assignments
- trash_ids:
- example-in-config-cf
assign_scores_to:
- name: ExampleProfile
score: 1000

quality_profiles:
# TODO: language not correctly mapped
- name: ExampleProfile
upgrade:
until_score: 200
# Not supported in whisparr
#min_format_score: 200
```

## Readarr v1

Experimental support for Readarr was added with [v1.5.0](https://github.com/raydak-labs/configarr/releases/tag/v1.4.0).

Configuration is mostly equal to the Sonarr or Radarr.

Following things are currently not supported or tested:

- quality definition preset is not evaluated
```yaml
quality_definition:
type: movies # not checked yet
```
- metadata profiles are not supported. This is a specific thing to readarr and requires custom implementation and breaking out of some abstraction layer we have in the code
- no available presets because nothings provided in trash guide or recyclarr -> needs to be done manually with local templates and custom formats

### Configuration File

Check [configuration file reference](/docs/configuration/config-file#custom-format-definitions) for more information.

```yaml title="config.yml"
localCustomFormatsPath: /app/cfs
localConfigTemplatesPath: /app/templates

customFormatDefinitions:
- trash_id: example-release-title-cf
trash_scores:
default: 0
name: ExampleReleaseTitleCF
includeCustomFormatWhenRenaming: false
specifications:
- name: Preferred Words
implementation: ReleaseTitleSpecification
negate: false
required: false
fields:
value: "\\b(SPARKS|Framestor)\\b"

# experimental support: check https://configarr.rayak.de/docs/configuration/experimental-support
readarr:
instance1: # Instance name (can be any unique identifier)
base_url: http://readarr:8787 # instance URL
api_key: !secret READARR_API_KEY # Reference to API key in secrets.yml

# not supported
# quality_definition:
# type: movies # Quality definition type

include:
# only custom defined templates available
- template: readarr

custom_formats: # Custom format assignments
- trash_ids:
- example-release-title-cf
assign_scores_to:
- name: ExampleProfile
score: 1000

quality_profiles:
- name: ExampleProfile
upgrade:
until_score: 200
```
4 changes: 2 additions & 2 deletions docs/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ Configarr is a powerful configuration and synchronization tool designed specific

### Experimental support

Experimental support also available for:
Experimental support also available for [(check experimental support)](./configuration/experimental-support):

- Whisparr v3
- Readarr v1

### Key Features

Expand Down Expand Up @@ -52,7 +53,6 @@ If you're managing a media server with Sonarr and Radarr (or other \*Arr tools),
Ready to streamline your media server configuration? Let's get started with the basic setup.

[Continue to Installation →](./category/installation)
[Check experimental support](./configuration/experimental-support)

### Related/Inspired Projects

Expand Down
40 changes: 40 additions & 0 deletions examples/full/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ customFormatDefinitions:
required: false
fields:
value: 4
- trash_id: example-release-title-cf
trash_scores:
default: 0
name: ExampleReleaseTitleCF
includeCustomFormatWhenRenaming: false
specifications:
- name: Preferred Words
implementation: ReleaseTitleSpecification
negate: false
required: false
fields:
value: "\\b(SPARKS|Framestor)\\b"

sonarr:
instance1:
Expand Down Expand Up @@ -107,3 +119,31 @@ whisparr:
until_score: 200
# Not supported in whisparr
#min_format_score: 200

readarr:
instance1: # Instance name (can be any unique identifier)
base_url: http://readarr:8787 # instance URL
api_key: !secret READARR_API_KEY # Reference to API key in secrets.yml

# not supported
# quality_definition:
# type: movies # Quality definition type

include:
# only custom defined templates available
- template: readarr

custom_formats: # Custom format assignments
- trash_ids:
- example-release-title-cf
assign_scores_to:
- name: ExampleProfile
score: 1000

quality_profiles:
# TODO: language not correctly mapped
- name: ExampleProfile
upgrade:
until_score: 200
# Not supported in whisparr
#min_format_score: 200
1 change: 1 addition & 0 deletions examples/full/config/secrets.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SONARR_API_KEY: 5e792b7e0fe14f58b8e92bf0902d4a44
RADARR_API_KEY: 0daa3a2b940f4e08bac991e9a30e9e12
WHISPARR_API_KEY: 2ebd18db81e14c2d98d06ef4b865aaa8
READARR_API_KEY: e001718ba38a424d8aae7cb391b5d27a
18 changes: 18 additions & 0 deletions examples/full/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ services:
- 6501:7878
restart: unless-stopped

# experimental
whisparr:
image: ghcr.io/hotio/whisparr:v3-3.0.0.695
networks:
Expand All @@ -45,6 +46,22 @@ services:
- ${PWD}/whisparr.xml:/config/config.xml:rw
restart: unless-stopped

# experimental
readarr:
image: lscr.io/linuxserver/readarr:develop-0.4.3.2665-ls130
networks:
- configarr-full
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
volumes:
- readarr:/config
- ${PWD}/readarr.xml:/config/config.xml:rw
ports:
- 6503:8787
restart: unless-stopped

networks:
configarr-full:
name: configarr-full
Expand All @@ -53,3 +70,4 @@ volumes:
sonarr:
radarr:
whisparr:
readarr:
17 changes: 17 additions & 0 deletions examples/full/readarr.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Config>
<BindAddress>*</BindAddress>
<Port>8787</Port>
<SslPort>6868</SslPort>
<EnableSsl>False</EnableSsl>
<LaunchBrowser>True</LaunchBrowser>
<ApiKey>e001718ba38a424d8aae7cb391b5d27a</ApiKey>
<AuthenticationMethod>Basic</AuthenticationMethod>
<AuthenticationRequired>DisabledForLocalAddresses</AuthenticationRequired>
<Branch>develop</Branch>
<LogLevel>debug</LogLevel>
<SslCertPath></SslCertPath>
<SslCertPassword></SslCertPassword>
<UrlBase></UrlBase>
<InstanceName>Readarr</InstanceName>
<UpdateMechanism>Docker</UpdateMechanism>
</Config>
13 changes: 13 additions & 0 deletions examples/full/templates/readarr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
quality_profiles:
- name: ExampleProfile
reset_unmatched_scores:
enabled: true
upgrade:
allowed: true
until_quality: MOBI
until_score: 1000
min_format_score: 5
quality_sort: top
qualities:
- name: EPUB
- name: MOBI
13 changes: 13 additions & 0 deletions generate-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const PATH_TO_OUTPUT_DIR = path.resolve(process.cwd(), "./src/__generated__");
const PATH_SONARR_DIR = path.resolve(PATH_TO_OUTPUT_DIR, "sonarr");
const PATH_RADARR_DIR = path.resolve(PATH_TO_OUTPUT_DIR, "radarr");
const PATH_WHISPARR_DIR = path.resolve(PATH_TO_OUTPUT_DIR, "whisparr");
const PATH_READARR_DIR = path.resolve(PATH_TO_OUTPUT_DIR, "readarr");

const main = async () => {
await generateApi({
Expand Down Expand Up @@ -41,9 +42,21 @@ const main = async () => {
},
});

await generateApi({
output: PATH_READARR_DIR,
url: "https://raw.githubusercontent.com/Readarr/Readarr/develop/src/Readarr.Api.V1/openapi.json",
modular: true,
singleHttpClient: true,
// @ts-ignore little hack to have one single client (we are deleting the weird created file for the http-client)
fileNames: {
httpClient: "../ky-client",
},
});

unlinkSync(path.resolve(PATH_SONARR_DIR, "..ts"));
unlinkSync(path.resolve(PATH_RADARR_DIR, "..ts"));
unlinkSync(path.resolve(PATH_WHISPARR_DIR, "..ts"));
unlinkSync(path.resolve(PATH_READARR_DIR, "..ts"));
};

main();
Loading