This code here overrides any poster added if you visit the torrents-details page of that specific torrent, even if you add a image yourself. This happens when the OMDB scrape does not have an image for the torrent. Can anyone help with an if/else or empty that if an image is already present, it will not overwrite it?
Probably this right?
if (($imdb_image = $TTIMDB->getImage_1($_data->Poster, $site_config['torrent_dir'] . "/images/", $id))) {
SQL_Query_exec("UPDATE `torrents` SET `image1` = '" . $imdb_image . "' WHERE `id` = $id");
}Probably this right?
if (empty($imdb_image = $TTIMDB->getImage_1($_data->Poster, $site_config['torrent_dir'] . "/images/", $id))) {
SQL_Query_exec("UPDATE `torrents` SET `image1` = '" . $imdb_image . "' WHERE `id` = $id");
}
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2022-10-08 01:06:23
