Skip to content

Commit

Permalink
Fix issue with some torrents getting mislabeled
Browse files Browse the repository at this point in the history
  • Loading branch information
Morea committed Dec 4, 2023
1 parent 816d3a6 commit fc6145f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
7 changes: 5 additions & 2 deletions Find Unique Titles/dist/find.unique.titles.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name Find Unique Titles
// @description Find unique titles to cross seed
// @version 0.0.6
// @version 0.0.7
// @author Mea01
// @match https://cinemageddon.net/browse.php*
// @match https://karagarga.in/browse.php*
Expand Down Expand Up @@ -126,9 +126,12 @@
} else if (response == _trackers_tracker__WEBPACK_IMPORTED_MODULE_5__.SearchResult.NOT_CHECKED) {
request.dom[0].setAttribute("title", "Title was not checked on target tracker");
request.dom[0].style.border = "2px solid #e74c3c";
} else if (response != _trackers_tracker__WEBPACK_IMPORTED_MODULE_5__.SearchResult.NOT_EXIST) {
} else if (response == _trackers_tracker__WEBPACK_IMPORTED_MODULE_5__.SearchResult.NOT_EXIST) {
request.dom[0].setAttribute("title", "Title was not found on target tracker");
request.dom[0].style.border = "2px solid #3498db";
} else if (response == _trackers_tracker__WEBPACK_IMPORTED_MODULE_5__.SearchResult.EXIST_BUT_MISSING_SLOT) {
request.dom[0].setAttribute("title", "Title exists but there is an available slot on target tracker");
request.dom[0].style.border = "2px solid #ff00ff";
}
}
} catch (e) {
Expand Down
16 changes: 13 additions & 3 deletions Find Unique Titles/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,18 @@ const main = async function () {
logger.debug(`[{0}] Parsing titles to check`, sourceTracker!!.name());
for await (const item of requestGenerator) {
const request = item as Request;
logger.debug(`[{0}] Search request: {1}`, sourceTracker!!.name(), request);
logger.debug(
`[{0}] Search request: {1}`,
sourceTracker!!.name(),
request
);
try {
if (
settings.useCache &&
request.imdbId &&
existsInCache(targetTracker.name(), request.imdbId)
) {
logger.debug("Title exists in target tracker, found using cache")
logger.debug("Title exists in target tracker, found using cache");
hideTorrents(request);
updateCount(i++);
continue;
Expand Down Expand Up @@ -122,12 +126,18 @@ const main = async function () {
"Title was not checked on target tracker"
);
request.dom[0].style.border = "2px solid #e74c3c";
} else if (response != SearchResult.NOT_EXIST) {
} else if (response == SearchResult.NOT_EXIST) {
request.dom[0].setAttribute(
"title",
"Title was not found on target tracker"
);
request.dom[0].style.border = "2px solid #3498db";
} else if (response == SearchResult.EXIST_BUT_MISSING_SLOT) {
request.dom[0].setAttribute(
"title",
"Title exists but there is an available slot on target tracker"
);
request.dom[0].style.border = "2px solid #ff00ff";
}
}
} catch (e) {
Expand Down
20 changes: 3 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fc6145f

Please sign in to comment.