add option to enable disable the tmdb support

This commit is contained in:
2020-07-18 01:10:04 +02:00
parent 8b89db6d5c
commit 1d9cf31f13
7 changed files with 98 additions and 13 deletions

View File

@ -2,7 +2,7 @@
class SSettings
{
private $database;
private ?Database $database;
/**
* SSettings constructor.
@ -19,4 +19,21 @@ class SSettings
$r = mysqli_fetch_assoc($result);
return $r['video_path'];
}
/**
* check if TMDB is enableds
* @return bool isenabled?
*/
public function isTMDBGrabbingEnabled(): bool
{
$query = "SELECT TMDB_grabbing from settings";
$result = $this->database->getConnection()->query($query);
if(!$result){
return true; // if undefined in db --> default true
}else{
$r = mysqli_fetch_assoc($result);
return $r['TMDB_grabbing'] == '1';
}
}
}