2020-07-15 18:08:22 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class SSettings
|
|
|
|
{
|
2020-07-17 23:10:04 +00:00
|
|
|
private ?Database $database;
|
2020-07-15 18:08:22 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* SSettings constructor.
|
|
|
|
*/
|
|
|
|
public function __construct() {
|
|
|
|
$this->database = Database::getInstance();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getVideoPath() {
|
|
|
|
$query = "SELECT video_path from settings";
|
|
|
|
|
|
|
|
$result = $this->database->getConnection()->query($query);
|
|
|
|
|
|
|
|
$r = mysqli_fetch_assoc($result);
|
|
|
|
return $r['video_path'];
|
|
|
|
}
|
2020-07-17 23:10:04 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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';
|
|
|
|
}
|
|
|
|
}
|
2020-07-15 18:08:22 +00:00
|
|
|
}
|