规范代码

master
iyuu.cn 5 years ago
parent 76c0cefca2
commit ea158ddd55
  1. 16
      app/AutoReseed.php
  2. 1
      iyuu.php

@ -414,7 +414,8 @@ class AutoReseed
/** /**
* IYUUAutoReseed辅种 * IYUUAutoReseed辅种
*/ */
public static function reseed($hashArray = array()){ public static function reseed($hashArray = array())
{
global $configALL; global $configALL;
$sites = array(); $sites = array();
// 前置过滤 // 前置过滤
@ -630,7 +631,8 @@ class AutoReseed
/** /**
* IYUUAutoReseed做种客户端转移 * IYUUAutoReseed做种客户端转移
*/ */
public static function move($hashArray = array()){ public static function move($hashArray = array())
{
global $configALL; global $configALL;
$sites = array(); $sites = array();
// 前置过滤:2020年1月26日15:52:41 // 前置过滤:2020年1月26日15:52:41
@ -823,11 +825,14 @@ class AutoReseed
/** /**
* 过滤已转移的种子hash * 过滤已转移的种子hash
*/ */
public static function hashFilter(&$hash = array()){ public static function hashFilter(&$hash = array())
{
foreach ($hash as $client => $json) { foreach ($hash as $client => $json) {
$data = array(); $data = array();
$data = json_decode($json, true); $data = json_decode($json, true);
if (empty($data)) continue; if (empty($data)) {
continue;
}
foreach ($data as $key => $info_hash) { foreach ($data as $key => $info_hash) {
if (is_file(self::$cacheMove . $info_hash.'.txt')) { if (is_file(self::$cacheMove . $info_hash.'.txt')) {
echo '-------当前种子上次已成功转移,前置过滤已跳过! ' .PHP_EOL.PHP_EOL; echo '-------当前种子上次已成功转移,前置过滤已跳过! ' .PHP_EOL.PHP_EOL;
@ -882,7 +887,8 @@ class AutoReseed
/** /**
* 获取站点种子的URL * 获取站点种子的URL
*/ */
public static function getTorrentUrl($site = '',$_url = ''){ public static function getTorrentUrl($site = '', $_url = '')
{
global $configALL; global $configALL;
switch ($site) { switch ($site) {
case 'ttg': case 'ttg':

@ -1,6 +1,7 @@
<?php <?php
require_once __DIR__ . '/init.php'; require_once __DIR__ . '/init.php';
use IYUU\AutoReseed; use IYUU\AutoReseed;
echo microtime(true).' IYUU自动辅种正在初始化...'.PHP_EOL; echo microtime(true).' IYUU自动辅种正在初始化...'.PHP_EOL;
AutoReseed::init(); AutoReseed::init();
$hashArray = AutoReseed::get(); $hashArray = AutoReseed::get();

Loading…
Cancel
Save