BinaryONe commited on
Commit
bb25507
·
1 Parent(s): a744064

Enabled Debugging - APi Changes

Browse files
FileStream/TMDB/Endpoint.py CHANGED
@@ -15,6 +15,9 @@ def search_tmdb_movies(name):
15
  # Filter results by year
16
  try:
17
  for result in search_results:
 
 
 
18
  if result.media_type == "movie":
19
  release_date=result.release_date or result.get("release_date") or result.get("first_air_date")
20
  if release_date and int(release_date.split('-')[0]) == year:
@@ -37,6 +40,8 @@ def search_tmdb_tv(name):
37
  # Filter results by year
38
  try:
39
  for result in search_results:
 
 
40
  if result.media_type == "tv":
41
  release_date=result.release_date or result.first_air_date or result.get("release_date") or result.get("first_air_date")
42
  if release_date and int(release_date.split('-')[0]) == year:
 
15
  # Filter results by year
16
  try:
17
  for result in search_results:
18
+ if not isinstance(result, dict):
19
+ result = dict(result)
20
+
21
  if result.media_type == "movie":
22
  release_date=result.release_date or result.get("release_date") or result.get("first_air_date")
23
  if release_date and int(release_date.split('-')[0]) == year:
 
40
  # Filter results by year
41
  try:
42
  for result in search_results:
43
+ if not isinstance(result, dict):
44
+ result = dict(result)
45
  if result.media_type == "tv":
46
  release_date=result.release_date or result.first_air_date or result.get("release_date") or result.get("first_air_date")
47
  if release_date and int(release_date.split('-')[0]) == year:
FileStream/server/routes_api.py CHANGED
@@ -34,6 +34,7 @@ async def list_10_all_files_db(request):
34
  #file_range = [file_list_no * 10 - 10 + 1, file_list_no * 10]
35
  db = Database(Telegram.DATABASE_URL, Telegram.SESSION_NAME)
36
  files, total_files = await db.find_all_files([1, 10])
 
37
  return web.json_response(json.loads(dumps(files)), headers=CORS_HEADERS)
38
 
39
  #return file_list, total_files
 
34
  #file_range = [file_list_no * 10 - 10 + 1, file_list_no * 10]
35
  db = Database(Telegram.DATABASE_URL, Telegram.SESSION_NAME)
36
  files, total_files = await db.find_all_files([1, 10])
37
+ print(files)
38
  return web.json_response(json.loads(dumps(files)), headers=CORS_HEADERS)
39
 
40
  #return file_list, total_files