Skip to content
This repository was archived by the owner on Jan 1, 2021. It is now read-only.

Commit 140276c

Browse files
committed
Added mappings api start (added enum)
1 parent 82f5ebd commit 140276c

5 files changed

Lines changed: 75 additions & 0 deletions

File tree

api_start.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ function utf8ize($mixed) {
5252
}
5353
}
5454

55+
function die_json($message) {
56+
$arr = array();
57+
$arr["error"] = $message;
58+
59+
$res = json_encode(utf8ize($arr));
60+
61+
echo $res;
62+
exit(1);
63+
}
64+
5565
function clean_title($title) {
5666
$title = strtolower($title);
5767
$title = str_replace("ä", "ae", $title);

imdb/.htaccess

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
RewriteEngine On
2+
#RewriteBase /
3+
# Unless directory, remove trailing slash
4+
#RewriteCond %{REQUEST_FILENAME} !-d
5+
#RewriteRule ^([^/]+)/$ https://radarr.video$1 [R=301,L]
6+
7+
# Redirect external .php requests to extensionless url
8+
RewriteCond %{THE_REQUEST} ^(.+)\.php([#?][^\ ]*)?\ HTTP/
9+
RewriteRule ^(.+)\.php$ $1 [R=301,L]
10+
11+
# Resolve .php file for extensionless php urls
12+
RewriteRule ^([^/.]+)$ $1.php [L]

imdb/top250.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
include("../api_start.php");
3+
4+
$listIds = exec("python IMDBAPI.py top250");
5+
$exploded = explode(",", $listIds);
6+
$orderedListIds = array();
7+
foreach($exploded as $id) {
8+
$orderedListIds[] = str_ireplace("'", "", $id);
9+
}
10+
//$ids = "1";
11+
$result = $db->query("SELECT m.* FROM movies m WHERE m.imdb_id in ($listIds)") or die_json(mysqli_error($db));
12+
13+
$response = array();
14+
15+
while ($arr = $result->fetch_assoc()) {
16+
$index = array_search($arr["imdb_id"], $orderedListIds);
17+
//var_dump($index);
18+
$response[$index] = $arr;
19+
// var_dump($arr);
20+
}
21+
22+
$resp = $response;
23+
ksort($resp);
24+
25+
$res = json_encode(utf8ize($resp));
26+
27+
echo $res;
28+
29+
30+
?>

invalid_files.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164453,3 +164453,17 @@ TMDBDUMP/458918.json
164453164453
TMDBDUMP/459625.json
164454164454
TMDBDUMP/459529.json
164455164455
TMDBDUMP/459711.json
164456+
TMDBDUMP/459528.json
164457+
TMDBDUMP/459529.json
164458+
TMDBDUMP/458918.json
164459+
TMDBDUMP/459625.json
164460+
TMDBDUMP/459711.json
164461+
TMDBDUMP/459751.json
164462+
TMDBDUMP/458918.json
164463+
TMDBDUMP/459528.json
164464+
TMDBDUMP/459529.json
164465+
TMDBDUMP/459625.json
164466+
TMDBDUMP/459711.json
164467+
TMDBDUMP/459751.json
164468+
TMDBDUMP/459796.json
164469+
TMDBDUMP/459798.json

mappings/mappings_start.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
abstract class MappingEventType {
3+
const Mapping_Added = 0;
4+
const Mapping_Upvoted = 1;
5+
const Mapping_Downvoted = 2;
6+
const Mapping_Locked = 3;
7+
}
8+
9+
?>

0 commit comments

Comments
 (0)