1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2025-02-21 13:56:57 +00:00

B2S-Share: fix search and title output (#2206)

Removed episode from search and added andmatch (episode search do not work with translated series name), changed title to return 'original name SXXEXX' instead of 'translated name SXXEXX (original name)', because Sonarr was not recognizing the serie (it will only apply to series and movies, animes does not have translated name)

The only drawback is that it will not search for very older episodes (not on first page), but that can be softened increasing the results per page in user profile, but i consider it way better than before, many series was not returning anything, since they had an translated name on the tracker, and an search with episode would work only searching for translated name and episode.
This commit is contained in:
DarkSupremo 2017-11-30 12:26:43 -02:00 committed by kaso17
parent 492816ab35
commit 5fbe1ce66e

View file

@ -217,12 +217,16 @@
paths:
- path: torrents-search.php
keywordsfilters:
- name: re_replace
args: ["[Ss][0-9]{2}[Ee][0-9]{2,3}", ""] # remove season and episode from search
- name: re_replace
args: ["[^a-zA-Z0-9]+", "%"]
inputs:
search: "{{ .Keywords }}"
rows:
selector: table[class^="ttable_headinner"] > tbody > tr:has(a[href^="torrents-details.php?id="])
filters:
- name: andmatch
fields:
details:
selector: a[href^="torrents-details.php?id="]
@ -238,6 +242,11 @@
args: ["(Ep[\\.]?[ ]?)|([S]\\d\\d[Ee])", "E"]
title_normal:
selector: a[href^="torrents-details.php?id="]
filters:
- name: re_replace
args: ["^(.*)[ ]([Ss][0-9]{2}[Ee][0-9]{2,3}).*(?:(?:\\((.*?)\\)))(.*$)", "$3 $2 $4"] # Convert series title from "Translated Name SXXEXX (Original Name) [Other stuffs]" to "Original Name SXXEXX [Other stuffs]"
- name: re_replace
args: ["^(.*)[ ].*(?:(?:\\((.*?)\\)))(.*$)", "$2 $3"] # Convert movies title from "Translated Name (Original Name) [Other stuffs]" to "Original Name [Other stuffs]"
title:
text: "{{if .Result.is_anime }}{{ .Result.title_anime }}{{else}}{{ .Result.title_normal }}{{end}}"
download: