Karan Adhikari commited on
Refactor extra parameters in catalog definitions
Browse files
Backend/fastapi/routes/stremio_routes.py
CHANGED
|
@@ -50,52 +50,74 @@ async def get_manifest():
|
|
| 50 |
"types": ["movie", "series"],
|
| 51 |
"resources": ["catalog", "meta", "stream"],
|
| 52 |
"catalogs": [
|
|
|
|
| 53 |
{
|
| 54 |
"type": "movie",
|
| 55 |
"id": "latest_movies",
|
| 56 |
"name": "Latest",
|
| 57 |
"extra": [
|
| 58 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
{"name": "skip"}
|
| 60 |
],
|
| 61 |
-
"
|
| 62 |
},
|
| 63 |
{
|
| 64 |
"type": "movie",
|
| 65 |
"id": "top_movies",
|
| 66 |
"name": "Popular",
|
| 67 |
"extra": [
|
| 68 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
{"name": "skip"},
|
| 70 |
-
{"name": "search"}
|
| 71 |
],
|
| 72 |
-
"
|
| 73 |
},
|
|
|
|
| 74 |
{
|
| 75 |
"type": "series",
|
| 76 |
"id": "latest_series",
|
| 77 |
"name": "Latest",
|
| 78 |
"extra": [
|
| 79 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
{"name": "skip"}
|
| 81 |
],
|
| 82 |
-
"
|
| 83 |
},
|
| 84 |
{
|
| 85 |
"type": "series",
|
| 86 |
"id": "top_series",
|
| 87 |
"name": "Popular",
|
| 88 |
"extra": [
|
| 89 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
{"name": "skip"},
|
| 91 |
-
{"name": "search"}
|
| 92 |
],
|
| 93 |
-
"
|
| 94 |
}
|
| 95 |
],
|
| 96 |
-
"idPrefixes": [""]
|
| 97 |
-
|
| 98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
@router.get("/catalog/{media_type}/{id}/{extra:path}.json")
|
| 100 |
@router.get("/catalog/{media_type}/{id}.json")
|
| 101 |
async def get_catalog(media_type: str, id: str, extra: Optional[str] = None):
|
|
|
|
| 50 |
"types": ["movie", "series"],
|
| 51 |
"resources": ["catalog", "meta", "stream"],
|
| 52 |
"catalogs": [
|
| 53 |
+
# Movie Catalogs
|
| 54 |
{
|
| 55 |
"type": "movie",
|
| 56 |
"id": "latest_movies",
|
| 57 |
"name": "Latest",
|
| 58 |
"extra": [
|
| 59 |
+
{
|
| 60 |
+
"name": "genre",
|
| 61 |
+
"isRequired": False,
|
| 62 |
+
"options": GENRES
|
| 63 |
+
},
|
| 64 |
{"name": "skip"}
|
| 65 |
],
|
| 66 |
+
"extraSupported": ["genre", "skip"]
|
| 67 |
},
|
| 68 |
{
|
| 69 |
"type": "movie",
|
| 70 |
"id": "top_movies",
|
| 71 |
"name": "Popular",
|
| 72 |
"extra": [
|
| 73 |
+
{
|
| 74 |
+
"name": "genre",
|
| 75 |
+
"isRequired": False,
|
| 76 |
+
"options": GENRES
|
| 77 |
+
},
|
| 78 |
{"name": "skip"},
|
| 79 |
+
{"name": "search", "isRequired": False}
|
| 80 |
],
|
| 81 |
+
"extraSupported": ["genre", "skip", "search"]
|
| 82 |
},
|
| 83 |
+
# Series Catalogs
|
| 84 |
{
|
| 85 |
"type": "series",
|
| 86 |
"id": "latest_series",
|
| 87 |
"name": "Latest",
|
| 88 |
"extra": [
|
| 89 |
+
{
|
| 90 |
+
"name": "genre",
|
| 91 |
+
"isRequired": False,
|
| 92 |
+
"options": GENRES
|
| 93 |
+
},
|
| 94 |
{"name": "skip"}
|
| 95 |
],
|
| 96 |
+
"extraSupported": ["genre", "skip"]
|
| 97 |
},
|
| 98 |
{
|
| 99 |
"type": "series",
|
| 100 |
"id": "top_series",
|
| 101 |
"name": "Popular",
|
| 102 |
"extra": [
|
| 103 |
+
{
|
| 104 |
+
"name": "genre",
|
| 105 |
+
"isRequired": False,
|
| 106 |
+
"options": GENRES
|
| 107 |
+
},
|
| 108 |
{"name": "skip"},
|
| 109 |
+
{"name": "search", "isRequired": False}
|
| 110 |
],
|
| 111 |
+
"extraSupported": ["genre", "skip", "search"]
|
| 112 |
}
|
| 113 |
],
|
| 114 |
+
"idPrefixes": [""],
|
| 115 |
+
"behaviorHints": {
|
| 116 |
+
"configurable": False,
|
| 117 |
+
"configurationRequired": False
|
| 118 |
+
}
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
@router.get("/catalog/{media_type}/{id}/{extra:path}.json")
|
| 122 |
@router.get("/catalog/{media_type}/{id}.json")
|
| 123 |
async def get_catalog(media_type: str, id: str, extra: Optional[str] = None):
|