add scanlator and people in db

main
cynic 4 years ago
parent 7731a61f30
commit e7eef743fc
  1. 2
      db/info.json
  2. 19
      db/test.json
  3. 2
      instance.php
  4. 4
      routes.php

@ -4,5 +4,5 @@
"operator": "cynic", "operator": "cynic",
"icon": "", "icon": "",
"description": "aaaathats4as", "description": "aaaathats4as",
"version": "0.1" "version": "0.1-php"
} }

@ -1,3 +1,5 @@
{
"manga":
[ [
{ {
"info": "info":
@ -31,10 +33,10 @@
"country_of_origin": "JP", "country_of_origin": "JP",
"publication_status": "Ongoing", "publication_status": "Ongoing",
"scanlation_status": true, "scanlation_status": true,
"mal_id": 0, "mal_id": 656,
"anilist_id": 0, "anilist_id": 30656,
"mangaupdates_id": 0, "mangaupdates_id": 387,
"last_updated": 1617791510, "last_updated": 1620137233,
"chapter_count": 328 "chapter_count": 328
}, },
"chapters": "chapters":
@ -4633,4 +4635,13 @@
} }
] ]
} }
],
"people":
[
],
"scanlators":
[
] ]
}

@ -11,7 +11,7 @@ class ml
} }
function getManga($id) function getManga($id)
{ {
foreach ($this->db as $manga) foreach ($this->db["manga"] as $manga)
{ {
if ($manga["info"]["id"] == $id) if ($manga["info"]["id"] == $id)
{ {

@ -2,6 +2,7 @@
include_once("instance.php"); include_once("instance.php");
function route($path, $ml) function route($path, $ml)
{ {
header('Content-Type:application/json');
switch ($path) switch ($path)
{ {
case "/info": case "/info":
@ -9,7 +10,7 @@ function route($path, $ml)
break; break;
case "/manga/search": case "/manga/search":
$response = []; $response = [];
foreach ($ml->db as $manga) foreach ($ml->db["manga"] as $manga)
{ {
array_push($response, $manga["info"]); array_push($response, $manga["info"]);
} }
@ -40,7 +41,6 @@ function route($path, $ml)
break; break;
default: default:
http_response_code(404); http_response_code(404);
return("lol@".$path);
} }
} }
?> ?>
Loading…
Cancel
Save