@@ -11,15 +11,15 @@ Master Table:
1111
1212Title Mappings:
1313
14- | master_id (Foreign Key) | aka_title |
14+ | mappingsid (Foreign Key) | aka_title |
1515| ----------| ---------------------|
1616| 1 | Star Wars: Whatevs |
1717| 2 | Ariel: What a beach |
1818| | |
1919
2020Year Mappings:
2121
22- | master_id (Foreign Key) | aka_year |
22+ | mappingsid (Foreign Key) | aka_year |
2323| ----------| ----------|
2424| 3 | 1978 |
2525| 4 | 1999 |
@@ -54,7 +54,9 @@ Add new Mapping
5454 "type" : "title",
5555 "tmdbid" : 11,
5656 "imdbid" : "tt0000011",
57- "aka_title" : "Star Wars"
57+ "aka_title" : "Star Wars",
58+ "report_count" : 1,
59+ "total_reports" : 1
5860}
5961```
6062
@@ -63,7 +65,9 @@ Add new Mapping
6365 "type" : "year",
6466 "tmdbid" : 11,
6567 "imdbid" : "tt0000011",
66- "aka_year" : 1978
68+ "aka_year" : 1978,
69+ "report_count" : 1,
70+ "total_reports" : 1
6771}
6872```
6973
@@ -76,29 +80,58 @@ Retrieve mappings for movie
7680| --------| ----------| ---------------------| ------|
7781| tmdbid | int | only when imdbid is present | - |
7882| imdbid | string (must match: /tt\d{7}/) | only when tmdbid is present | - |
83+ | type | string (either "title", "year" or "all" | yes | all |
7984| min_report | int | yes | 3 |
8085
8186#### Sample Request
8287
83- ` GET /mappings/get?tmdbid=11&min_report=5 `
88+ ` GET /mappings/get?tmdbid=11&min_report=-50 `
89+ ` GET /mappings/get?tmdbid=11&min_report=5&type=title `
8490
8591#### Sample Response
8692
8793```
88- [
89- {
90- "type" : "title",
91- "tmdbid" : 11,
92- "imdbid" : "tt0000011",
93- "aka_title" : "Star Wars"
94- },
95- {
96- "type" : "year",
97- "tmdbid" : 11,
98- "imdbid" : "tt0000011",
99- "aka_year" : 1978
100- }
101- ]
94+ {
95+ "tmdbid" : 11,
96+ "imdbid" : "tt0000011",
97+ "titles" : [
98+ {
99+ "id" : 1,
100+ "type" : "title",
101+ "aka_title" : "Star Wars",
102+ "report_count" : 15,
103+ "total_reports" : 20,
104+ "locked" : false
105+ }
106+ ],
107+ "years" : [
108+ {
109+ "id" : 2,
110+ "type" : "year",
111+ "aka_year" : 1978,
112+ "report_count" : -4,
113+ "total_reports" : 6,
114+ "locked" : true
115+ }
116+ ]
117+ }
118+ ```
119+
120+ ```
121+ {
122+ "tmdbid" : 11,
123+ "imdbid" : "tt0000011",
124+ "titles" : [
125+ {
126+ "id" : 1,
127+ "type" : "title",
128+ "aka_title" : "Star Wars",
129+ "report_count" : 15,
130+ "total_reports" : 20,
131+ "locked" : false
132+ }
133+ ]
134+ }
102135```
103136
104137## "Rate Limiting"
@@ -107,7 +140,7 @@ Each IP Address can only "vote" on a mapping once a day.
107140
108141### Table for IP Addresses
109142
110- | ip | masterid |
143+ | ip | mappingsid |
111144| --| --|
112145| 192.168.1.117 | 2 |
113146
0 commit comments