nyaasi: add sonarr compatibility setting for release titles

This commit is contained in:
Bogdan
2023-05-01 01:13:01 +03:00
parent dcf9df0c74
commit 5b6b8d8697

View File

@@ -31,6 +31,10 @@ settings:
type: checkbox type: checkbox
label: Prefer Magnet Links label: Prefer Magnet Links
default: true 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 - name: filter-id
type: select type: select
label: Filter label: Filter
@@ -154,14 +158,16 @@ search:
args: ["_", 0] args: ["_", 0]
title_default: title_default:
selector: td:nth-child(2) a:last-of-type selector: td:nth-child(2) a:last-of-type
title_spanish: title_phase1:
selector: td:nth-child(2) a:last-of-type:contains("[PuyaSubs!] ") selector: td:nth-child(2) a:last-of-type:contains("[PuyaSubs!] ")
optional: true optional: true
filters: filters:
- name: append - name: append
args: " Spanish" args: " Spanish"
title_optional: title_phase2:
text: "{{ or (.Result.title_spanish) (.Result.title_default) }}" text: "{{ or (.Result.title_phase1) (.Result.title_default) }}"
title_phase3:
text: "{{ .Result.title_phase2 }}"
filters: filters:
- name: re_replace - name: re_replace
args: ["(?i)\\b((?:S|Seasons?|EP?|Episodes?)\\s?)(\\d+)(?:\\-|[\\s~\\+àa&]+)(\\d+)\\b", "$1$2-$3"] args: ["(?i)\\b((?:S|Seasons?|EP?|Episodes?)\\s?)(\\d+)(?:\\-|[\\s~\\+àa&]+)(\\d+)\\b", "$1$2-$3"]
@@ -192,24 +198,26 @@ search:
- name: re_replace - name: re_replace
args: ["(?i)\\b(?:EP|Episodes?)\\s?(\\d+(?:-\\d+)?)\\b(?!(?:-\\d+)?\\sS\\d+(?:-\\d+)?(?:E\\d+(?:-\\d+)?)?)", "$0 S01E$1"] args: ["(?i)\\b(?:EP|Episodes?)\\s?(\\d+(?:-\\d+)?)\\b(?!(?:-\\d+)?\\sS\\d+(?:-\\d+)?(?:E\\d+(?:-\\d+)?)?)", "$0 S01E$1"]
title_has_season: title_has_season:
text: "{{ .Result.title_optional }}" text: "{{ .Result.title_phase3 }}"
filters: filters:
- name: regexp - name: regexp
args: "(?i)(S\\d{1,3}(E\\d+)?)" args: "(?i)(S\\d{1,3}(E\\d+)?)"
- name: append - name: append
args: "NULL" args: "NULL"
title_has_episode: title_has_episode:
text: "{{ .Result.title_optional }}" text: "{{ .Result.title_phase3 }}"
filters: filters:
- name: regexp - name: regexp
args: "\\b(.+? - ?)(\\d+) ([\\[\\(])\\b" args: "\\b(.+? - ?)(\\d+) ([\\[\\(])\\b"
- name: append - name: append
args: "NULL" args: "NULL"
title: title_optional:
text: "{{ .Result.title_optional }}" text: "{{ .Result.title_phase3 }}"
filters: filters:
- name: append - 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 }}" 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: details:
selector: td:nth-child(2) a:last-of-type selector: td:nth-child(2) a:last-of-type
attribute: href attribute: href