From 43622f8f592e71aeffbf996258814000cd69d0df Mon Sep 17 00:00:00 2001 From: ilike2burnthing <59480337+ilike2burnthing@users.noreply.github.com> Date: Sun, 13 Aug 2023 22:56:17 +0100 Subject: [PATCH] yggtorrent: make strip season optional. resolves #14565 (#14629) --- src/Jackett.Common/Definitions/yggcookie.yml | 6 +++++- src/Jackett.Common/Definitions/yggtorrent.yml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Jackett.Common/Definitions/yggcookie.yml b/src/Jackett.Common/Definitions/yggcookie.yml index e14306b20..442bca405 100644 --- a/src/Jackett.Common/Definitions/yggcookie.yml +++ b/src/Jackett.Common/Definitions/yggcookie.yml @@ -145,6 +145,10 @@ settings: type: checkbox label: Normalize release names by moving year after the title default: false + - name: strip_season + type: checkbox + label: Strip season only (e.g. S01) from searches, as tracker does not support partial matches + default: true - name: enhancedAnime type: checkbox label: Enhance Sonarr compatibility with anime by renaming episodes (xxx > Exxx). Can disturb movies search (e.g. Back To The Future 3 > Back To The Future E3). @@ -353,7 +357,7 @@ search: args: ["[\\\\\\-\\.\\/!\\s]+", " "] # strip season as site does not support partial matches - name: re_replace - args: ["(?i)\\bS\\d{1,3}\\b", ""] + args: ["(?i)\\b(S\\d{1,3})\\b", "{{ if .Config.strip_season }}{{ else }}$1{{ end }}"] - name: trim # put each word in quotations to prevent exact phrase search - name: re_replace diff --git a/src/Jackett.Common/Definitions/yggtorrent.yml b/src/Jackett.Common/Definitions/yggtorrent.yml index 58f737f9d..3728c757b 100644 --- a/src/Jackett.Common/Definitions/yggtorrent.yml +++ b/src/Jackett.Common/Definitions/yggtorrent.yml @@ -137,6 +137,10 @@ settings: type: checkbox label: Normalize release names by moving year after the title default: false + - name: strip_season + type: checkbox + label: Strip season only (e.g. S01) from searches, as tracker does not support partial matches + default: true - name: enhancedAnime type: checkbox label: Enhance Sonarr compatibility with anime by renaming episodes (xxx > Exxx). Can disturb movies search (e.g. Back To The Future 3 > Back To The Future E3). @@ -357,7 +361,7 @@ search: args: ["[\\\\\\-\\.\\/!\\s]+", " "] # strip season as site does not support partial matches - name: re_replace - args: ["(?i)\\bS\\d{1,3}\\b", ""] + args: ["(?i)\\b(S\\d{1,3})\\b", "{{ if .Config.strip_season }}{{ else }}$1{{ end }}"] - name: trim # put each word in quotations to prevent exact phrase search - name: re_replace