Series Detail Screen
This commit is contained in:
@@ -247,6 +247,8 @@ try {
|
||||
sh.resolution AS resolution,
|
||||
sh.poster_path AS poster_path,
|
||||
sh.first_air_year AS first_air_year,
|
||||
sh.id AS show_id,
|
||||
sh.download_path AS download_path,
|
||||
JSON_UNQUOTE(JSON_EXTRACT(sh.json, '$.status')) AS show_status,
|
||||
sh.cliffhanger AS show_cliffhanger,
|
||||
sh.json AS show_json,
|
||||
@@ -256,6 +258,8 @@ try {
|
||||
sh.resolution AS resolution,
|
||||
sh.poster_path AS poster_path,
|
||||
NULL AS first_air_year,
|
||||
sh.id AS show_id,
|
||||
sh.download_path AS download_path,
|
||||
JSON_UNQUOTE(JSON_EXTRACT(sh.json, '$.status')) AS show_status,
|
||||
sh.cliffhanger AS show_cliffhanger,
|
||||
sh.json AS show_json,
|
||||
@@ -266,6 +270,8 @@ try {
|
||||
sh.resolution AS resolution,
|
||||
sh.poster_path AS poster_path,
|
||||
sh.first_air_year AS first_air_year,
|
||||
sh.id AS show_id,
|
||||
sh.download_path AS download_path,
|
||||
sh.cliffhanger AS show_cliffhanger,
|
||||
sh.json AS show_json,
|
||||
se.season_number, sh.name AS show_name ".$base;
|
||||
@@ -274,6 +280,8 @@ try {
|
||||
sh.resolution AS resolution,
|
||||
sh.poster_path AS poster_path,
|
||||
NULL AS first_air_year,
|
||||
sh.id AS show_id,
|
||||
sh.download_path AS download_path,
|
||||
sh.cliffhanger AS show_cliffhanger,
|
||||
sh.json AS show_json,
|
||||
se.season_number, sh.name AS show_name ".$base;
|
||||
@@ -357,6 +365,22 @@ try {
|
||||
resp(['ok' => true, 'id' => $id ? (int)$id : null]);
|
||||
}
|
||||
|
||||
case 'set_show_meta': {
|
||||
$showId = (int)($in['show_id'] ?? 0);
|
||||
if (!$showId) fail('bad params');
|
||||
$fields = [];
|
||||
$params = [];
|
||||
if (isset($in['resolution'])) { $fields[] = 'resolution = ?'; $params[] = $in['resolution']; }
|
||||
if (array_key_exists('download_path', $in)) { $fields[] = 'download_path = ?'; $params[] = $in['download_path']; }
|
||||
if (isset($in['cliffhanger'])) { $fields[] = 'cliffhanger = ?'; $params[] = (int)!!$in['cliffhanger']; }
|
||||
if (empty($fields)) fail('no fields');
|
||||
$sql = 'UPDATE shows SET '.implode(', ', $fields).' WHERE id = ?';
|
||||
$params[] = $showId;
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute($params);
|
||||
resp(['ok'=>true]);
|
||||
}
|
||||
|
||||
case 'ping': {
|
||||
resp([
|
||||
'ok' => true,
|
||||
|
||||
Reference in New Issue
Block a user