Spaces:
Running
Running
BinaryONe
commited on
Commit
·
4aedd57
1
Parent(s):
50586c0
AllFilesDB
Browse files
FileStream/server/API/listings.py
CHANGED
@@ -52,24 +52,24 @@ async def AllSeries10(request: web.Request):
|
|
52 |
})
|
53 |
return web.json_response({"count": len(results), "results": results, "next_offset": next_offset}) # Correct JSON response format
|
54 |
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
|
74 |
|
75 |
|
|
|
52 |
})
|
53 |
return web.json_response({"count": len(results), "results": results, "next_offset": next_offset}) # Correct JSON response format
|
54 |
|
55 |
+
async def Leatest10(request: web.Request):
|
56 |
+
offset = request.rel_url.query.get('offset', 0) if request.rel_url.query.get('offset' ,0) else 0
|
57 |
+
results=[]
|
58 |
+
files, next_offset = await db.GetLatestAllBy10(offset=offset)
|
59 |
+
for file in files:
|
60 |
+
results.append({
|
61 |
+
"poster":file['poster'],
|
62 |
+
"title":file['title'],
|
63 |
+
"release_date":file['release_date'],
|
64 |
+
"genre":file['genre'],
|
65 |
+
"imdb_id":file['IMDB_id'],
|
66 |
+
"type":file['type'],
|
67 |
+
"file_name": file['file']['file_name'],
|
68 |
+
"document_file_id": file['file']['file_id'],
|
69 |
+
"caption": file['file']['file_name'] or "",
|
70 |
+
"description": f"Size: {humanbytes(file['file']['file_size'])}\nType: {file['file']['mime_type']}",
|
71 |
+
})
|
72 |
+
return web.json_response({"count": len(results), "results": results, "next_offset": next_offset}) # Correct JSON response format
|
73 |
|
74 |
|
75 |
|
FileStream/server/__init__.py
CHANGED
@@ -48,8 +48,6 @@ def web_server():
|
|
48 |
web_app.add_subapp('/app', app)
|
49 |
web_app.add_subapp('/api', api)
|
50 |
web_app.add_subapp('/auth', auth)
|
51 |
-
|
52 |
# Add static file handler
|
53 |
web_app.router.add_static('/static/', template_folder)
|
54 |
-
|
55 |
return web_app
|
|
|
48 |
web_app.add_subapp('/app', app)
|
49 |
web_app.add_subapp('/api', api)
|
50 |
web_app.add_subapp('/auth', auth)
|
|
|
51 |
# Add static file handler
|
52 |
web_app.router.add_static('/static/', template_folder)
|
|
|
53 |
return web_app
|