mirror of
https://github.com/g0ldyy/comet.git
synced 2026-01-12 01:16:12 +01:00
feat: add option to toggle title checking
This commit is contained in:
+2
-4
@@ -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"
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user