feat: add option to toggle title checking

This commit is contained in:
Goldy
2024-07-04 12:04:08 +02:00
parent ffdcabfa0b
commit bbb257dda8
2 changed files with 8 additions and 4 deletions
+2 -4
View File
@@ -170,14 +170,12 @@ async def stream(request: Request, b64config: str, type: str, id: str):
object = {
"Title": result["filename"],
"InfoHash": result["infoHash"],
"zilean": True,
}
if indexer_manager_type == "prowlarr":
object = {
"title": result["filename"],
"infoHash": result["infoHash"],
"zilean": True,
}
torrents.append(object)
@@ -195,9 +193,9 @@ async def stream(request: Request, b64config: str, type: str, id: str):
tasks = []
filtered = 0
filter_title = config["filterTitles"] if "filterTitles" in config else True # not needed when pydantic config validation system implemented
for torrent in torrents:
# Only title match check if from Zilean
if "zilean" in torrent:
if filter_title:
parsed_torrent = parse(
torrent["Title"]
if indexer_manager_type == "jackett"
+6
View File
@@ -510,6 +510,10 @@
<sl-input id="maxResults" type="number" min=0 value=0 label="Max Results" placeholder="Enter max results"></sl-input>
</div>
<div class="form-item">
<sl-checkbox id="filterTitles" checked help-text="Should Comet check for title mismatch?">Filter Titles</sl-checkbox>
</div>
<div class="form-item">
<sl-select id="debridService" value="realdebrid" label="Debrid Service" placeholder="Select debrid service">
<sl-option value="realdebrid">Real-Debrid</sl-option>
@@ -573,6 +577,7 @@
const languages = Array.from(document.getElementById("languages").selectedOptions).map(option => option.value);
const resolutions = Array.from(document.getElementById("resolutions").selectedOptions).map(option => option.value);
const maxResults = document.getElementById("maxResults").value;
const filterTitles = document.getElementById("filterTitles").checked;
const selectedLanguages = languages.length === defaultLanguages.length && languages.every((val, index) => val === defaultLanguages[index]) ? ["All"] : languages;
const selectedResolutions = resolutions.length === defaultResolutions.length && resolutions.every((val, index) => val === defaultResolutions[index]) ? ["All"] : resolutions;
@@ -582,6 +587,7 @@
debridApiKey: debridApiKey,
indexers: indexers,
maxResults: parseInt(maxResults),
filterTitles: filterTitles,
resolutions: selectedResolutions,
languages: selectedLanguages
};