From 5b6b8d869740cc268ba96f77a7fc46c036b477f8 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Mon, 1 May 2023 01:13:01 +0300 Subject: [PATCH] nyaasi: add sonarr compatibility setting for release titles --- src/Jackett.Common/Definitions/nyaasi.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/Jackett.Common/Definitions/nyaasi.yml b/src/Jackett.Common/Definitions/nyaasi.yml index d4416e804..d1aaef119 100644 --- a/src/Jackett.Common/Definitions/nyaasi.yml +++ b/src/Jackett.Common/Definitions/nyaasi.yml @@ -31,6 +31,10 @@ settings: type: checkbox label: Prefer Magnet Links default: true + - name: sonarr_compatibility + type: checkbox + label: Improve Sonarr compatibility by trying to add Season information into Release Titles + default: false - name: filter-id type: select label: Filter @@ -154,14 +158,16 @@ search: args: ["_", 0] title_default: selector: td:nth-child(2) a:last-of-type - title_spanish: + title_phase1: selector: td:nth-child(2) a:last-of-type:contains("[PuyaSubs!] ") optional: true filters: - name: append args: " Spanish" - title_optional: - text: "{{ or (.Result.title_spanish) (.Result.title_default) }}" + title_phase2: + text: "{{ or (.Result.title_phase1) (.Result.title_default) }}" + title_phase3: + text: "{{ .Result.title_phase2 }}" filters: - name: re_replace args: ["(?i)\\b((?:S|Seasons?|EP?|Episodes?)\\s?)(\\d+)(?:\\-|[\\s~\\+àa&]+)(\\d+)\\b", "$1$2-$3"] @@ -192,24 +198,26 @@ search: - name: re_replace args: ["(?i)\\b(?:EP|Episodes?)\\s?(\\d+(?:-\\d+)?)\\b(?!(?:-\\d+)?\\sS\\d+(?:-\\d+)?(?:E\\d+(?:-\\d+)?)?)", "$0 S01E$1"] title_has_season: - text: "{{ .Result.title_optional }}" + text: "{{ .Result.title_phase3 }}" filters: - name: regexp args: "(?i)(S\\d{1,3}(E\\d+)?)" - name: append args: "NULL" title_has_episode: - text: "{{ .Result.title_optional }}" + text: "{{ .Result.title_phase3 }}" filters: - name: regexp args: "\\b(.+? - ?)(\\d+) ([\\[\\(])\\b" - name: append args: "NULL" - title: - text: "{{ .Result.title_optional }}" + title_optional: + text: "{{ .Result.title_phase3 }}" filters: - name: append args: "{{ if and (eq .Result.category_group_id \"1\") (and (eq .Result.title_has_season \"NULL\") (eq .Result.title_has_episode \"NULL\")) }} S01{{ else }}{{ end }}" + title: + text: "{{ if .Config.sonarr_compatibility }}{{ .Result.title_optional }}{{ else }}{{ .Result.title_phase2 }}{{ end }}" details: selector: td:nth-child(2) a:last-of-type attribute: href