Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions plugins/rutracker_check/check.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require_once( "../../php/Snoopy.class.inc" );
require_once( "../../php/rtorrent.php" );
require_once( "../../php/util.php" );

require_once( "trackers/rutracker.php" );
require_once( "trackers/anidub.php" );
Expand All @@ -11,6 +12,8 @@
require_once( "trackers/tfile.php" );
require_once( "trackers/toloka.php" );

eval(FileUtil::getPluginConf( "rutracker_check" ));

class ruTrackerChecker
{
const STE_INPROGRESS = 1;
Expand All @@ -20,6 +23,7 @@ class ruTrackerChecker
const STE_CANT_REACH_TRACKER = 5;
const STE_ERROR = 6;
const STE_NOT_NEED = 7;
const STE_IGNORED = 8;

const MAX_LOCK_TIME = 900; // 15 min

Expand Down Expand Up @@ -51,18 +55,20 @@ static protected function setState( $hash, $state )
return($req->success());
}

static protected function getState( $hash, &$state, &$time, &$successful_time )
static protected function getState( $hash, &$state, &$time, &$successful_time, &$label )
{
$req = new rXMLRPCRequest( array(
new rXMLRPCCommand( getCmd("d.get_custom"), array($hash, "chk-state") ),
new rXMLRPCCommand( getCmd("d.get_custom"), array($hash, "chk-time") ),
new rXMLRPCCommand( getCmd("d.get_custom"), array($hash, "chk-stime") )
new rXMLRPCCommand( getCmd("d.get_custom"), array($hash, "chk-stime") ),
new rXMLRPCCommand( getCmd("d.get_custom1"), $hash )
));
if($req->success())
{
$state = intval($req->val[0]);
$time = intval($req->val[1]);
$successful_time = intval($req->val[2]);
$label = $req->val[3];
return(true);
}
else
Expand Down Expand Up @@ -140,9 +146,18 @@ static public function makeClient( $url, $method="GET", $content_type="", $body=
return($client);
}

static public function run( $hash, $state = null, $time = null, $successful_time = null )
static public function run( $hash, $state = null, $time = null, $successful_time = null, $label = null )
{
if(is_null($state)) self::getState( $hash, $state, $time, $successful_time );
global $ignoreLabels;

if(is_null($state)) self::getState( $hash, $state, $time, $successful_time, $label );

if (!is_null($label) && in_array($label, $ignoreLabels)) {
$state = self::STE_IGNORED;
self::setState($hash, $state);
return(true);
}

if(($state==self::STE_INPROGRESS) && ((time()-$time)>self::MAX_LOCK_TIME)) $state = 0;

if($state!==self::STE_INPROGRESS){
Expand Down
1 change: 1 addition & 0 deletions plugins/rutracker_check/conf.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php

$updateInterval = 60; // in minutes, zero for disable
$ignoreLabels = ['tv-sonarr', 'radarr']; // list of labels to ignore
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/cs.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Probably deleted",
"Error accessing the tracker",
"Error interacting with rTorrent",
"No need"
"No need",
"Ignored"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/da.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Probably deleted",
"Error accessing the tracker",
"Error interacting with rTorrent",
"No need"
"No need",
"Ignored"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Wahrscheinlich gelöscht",
"Fehler beim Zugriff auf Tracker",
"Fehler beim Interagieren mit rTorrent",
"Nicht nötig"
"Nicht nötig",
"Ignoriert"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/el.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Μάλλον διαγράφηκε",
"Σφάλμα πρόσβασης στον tracker",
"Σφάλμα αλληλεπίδρασης με το rTorrent",
"Δεν χρειάζεται"
"Δεν χρειάζεται",
"Αγνοήθηκε"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Probably deleted",
"Error accessing the tracker",
"Error interacting with rTorrent",
"No need"
"No need",
"Ignored"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Probably deleted",
"Error accessing the tracker",
"Error interacting with rTorrent",
"No need"
"No need",
"Ignored"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/fi.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Probably deleted",
"Error accessing the tracker",
"Error interacting with rTorrent",
"No need"
"No need",
"Ignored"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Certainement supprimé",
"Erreur d'accès au tracker",
"Problème d'accès à rTorrent",
"Pas besoin"
"Pas besoin",
"Ignoré"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/hu.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Probably deleted",
"Error accessing the tracker",
"Error interacting with rTorrent",
"No need"
"No need",
"Ignored"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
3 changes: 2 additions & 1 deletion plugins/rutracker_check/lang/it.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Probabilmente cancellato",
"Errore di accesso al tracker",
"Errore di interazione con rTorrent",
"Non serve"
"Non serve",
"Ignorato"
];

thePlugins.get("rutracker_check").langLoaded();
3 changes: 2 additions & 1 deletion plugins/rutracker_check/lang/ko.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"아마 삭제됨",
"트래커 접근 중 오류",
"rTorrent 통신 오류",
"불필요함"
"불필요함",
"무시됨"
];

thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/lv.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Probably deleted",
"Error accessing the tracker",
"Error interacting with rTorrent",
"No need"
"No need",
"Ignored"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Probably deleted",
"Error accessing the tracker",
"Error interacting with rTorrent",
"No need"
"No need",
"Ignored"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/no.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Sannsynligvis slettet",
"Tilgangsfeil med trackeren oppstod",
"Kommunikasjonsfeil med rTorrent oppstod",
"Ikke nødvendig"
"Ikke nødvendig",
"Ignorert"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/pl.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Prawdopodobnie usunięte",
"Błąd podczas próby dostępu do trackera",
"Błąd interakcji z rTorrentem",
"Nie potrzeba"
"Nie potrzeba",
"Zignorowano"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/pt-br.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Probably deleted",
"Error accessing the tracker",
"Error interacting with rTorrent",
"No need"
"No need",
"Ignored"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/pt-pt.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Provavelmente apagado",
"Erro ao acessar o rastreador",
"Erro ao interagir com o rTorrent",
"Não há necessidade"
"Não há necessidade",
"Ignorado"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Возможно, удален",
"Ошибка доступа к трекеру",
"Ошибка взаимодействия с rTorrent",
"Нет необходимости"
"Нет необходимости",
"Игнорируется"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/sk.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Probably deleted",
"Error accessing the tracker",
"Error interacting with rTorrent",
"No need"
"No need",
"Ignored"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/sr.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Probably deleted",
"Error accessing the tracker",
"Error interacting with rTorrent",
"No need"
"No need",
"Ignored"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
3 changes: 2 additions & 1 deletion plugins/rutracker_check/lang/sv.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Förmodligen borttagen",
"Fel, uppstigning tracker",
"Fel vid interaktivitet med rTorrent",
"Behövs inte"
"Behövs inte",
"Ignorerad"
];

thePlugins.get("rutracker_check").langLoaded();
9 changes: 5 additions & 4 deletions plugins/rutracker_check/lang/tr.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
theUILang.chkResults = [
"Sürüyor",
"Güncellendi",
"Güncelleme gerekli değil",
"Güncelleme gerekli değil",
"Muhtemelen silindi",
"İzleyiciye erişim hatası",
"rTorrent ile etkileşim hatası",
"Gerek yok"
"İzleyiciye erişim hatası",
"rTorrent ile etkileşim hatası",
"Gerek yok",
"Yoksayılmış"
];

thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/uk.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Імовірно, видалено",
"Сталася помилка доступу до трекера",
"Сталася помилка взаємодії з rTorrent",
"Немає необхідності"
"Немає необхідності",
"Ігнорується"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/vi.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Có thể đã xóa",
"Lỗi truy cập máy theo dỗi",
"Lỗi giao tiếp với rTorrent",
"Không cần thiết"
"Không cần thiết",
"Bị bỏ qua"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/zh-cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Probably deleted",
"Error accessing the tracker",
"Error interacting with rTorrent",
"No need"
"No need",
"Ignored"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
5 changes: 3 additions & 2 deletions plugins/rutracker_check/lang/zh-tw.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"Probably deleted",
"Error accessing the tracker",
"Error interacting with rTorrent",
"No need"
"No need",
"Ignored"
];

thePlugins.get("rutracker_check").langLoaded();
thePlugins.get("rutracker_check").langLoaded();
Loading