Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Commit

Permalink
Rename "dual" -> "multi"
Browse files Browse the repository at this point in the history
  • Loading branch information
jacklul committed May 4, 2018
1 parent b58165a commit 51980bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions src/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ class App
*
* @var string
*/
private $USE_DUAL_SEARCH = true;
private $USE_MULTI_SEARCH = true;

/**
* Forces searching on all services even when links are already found
*
* @var string
*/
private $FORCE_DUAL_SEARCH = false;
private $FORCE_MULTI_SEARCH = false;

/**
* Is the main loop running? (for signal handler)
Expand Down Expand Up @@ -452,12 +452,12 @@ public function readConfig($file)
$this->USE_CONVERSION = $config['USE_CONVERSION'];
}

if (isset($config['USE_DUAL_SEARCH'])) {
$this->USE_DUAL_SEARCH = $config['USE_DUAL_SEARCH'];
if (isset($config['USE_MULTI_SEARCH'])) {
$this->USE_MULTI_SEARCH = $config['USE_MULTI_SEARCH'];
}

if (isset($config['FORCE_DUAL_SEARCH'])) {
$this->FORCE_DUAL_SEARCH = $config['FORCE_DUAL_SEARCH'];
if (isset($config['FORCE_MULTI_SEARCH'])) {
$this->FORCE_MULTI_SEARCH = $config['FORCE_MULTI_SEARCH'];
}

if (isset($config['RETURN_TIMEOUT'])) {
Expand Down Expand Up @@ -1132,7 +1132,7 @@ private function main()
if ($this->REVERSE_SEARCH) {
$service = 'iqdb.harry.lu';

if ($this->USE_DUAL_SEARCH) {
if ($this->USE_MULTI_SEARCH) {
$this->LINE_BUFFER = " Trying reverse search #1 (iqdb.harry.lu)...";
} else {
$this->LINE_BUFFER = " Trying reverse search...";
Expand All @@ -1144,8 +1144,8 @@ private function main()

print("\r" . $this->LINE_BUFFER);

if ($this->USE_DUAL_SEARCH && (!is_array($results) || isset($results['error']) || $this->FORCE_DUAL_SEARCH)) {
if ($this->FORCE_DUAL_SEARCH) {
if ($this->USE_MULTI_SEARCH && (!is_array($results) || isset($results['error']) || $this->FORCE_MULTI_SEARCH)) {
if ($this->FORCE_MULTI_SEARCH) {
$results_prev = null;
if (is_array($results) && count($results) > 0 && !isset($results['error'])) {
$results_prev = $results;
Expand All @@ -1166,7 +1166,7 @@ private function main()

$results = $this->reverseSearchAlt($this->PATH_IMAGES . '/' . $entry);

if ($this->FORCE_DUAL_SEARCH) {
if ($this->FORCE_MULTI_SEARCH) {
if ($results_prev !== null) {
$results = array_merge($results_prev, $results);
$results = array_unique($results);
Expand Down
4 changes: 2 additions & 2 deletions src/config.cfg.example
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
;USE_CONVERSION=true

; Use 'saucenao.com' as additional service for reverse search (default: true)
;USE_DUAL_SEARCH=true
;USE_MULTI_SEARCH=true

; Forces searching on all services even when links are already found (default: false)
;FORCE_DUAL_SEARCH=false
;FORCE_MULTI_SEARCH=false

; Maximum time the script waits for reply per image search (default: 60)
; Set it to higher number on weaker connections or errors like 'no reply from the server'
Expand Down

0 comments on commit 51980bf

Please # to comment.