ChandimaPrabath commited on
Commit
1685898
·
1 Parent(s): fe17250
Files changed (3) hide show
  1. LoadBalancer.py +0 -1
  2. app.py +1 -1
  3. indexer.py +3 -2
LoadBalancer.py CHANGED
@@ -1,5 +1,4 @@
1
  import os
2
- import json
3
  from indexer import indexer
4
  import re
5
  from tvdb import fetch_and_cache_json
 
1
  import os
 
2
  from indexer import indexer
3
  import re
4
  from tvdb import fetch_and_cache_json
app.py CHANGED
@@ -68,7 +68,7 @@ async def get_tv_metadata_api(title: str):
68
  data = await read_json_file(json_cache_path)
69
 
70
  # Add the file structure to the metadata
71
- tv_structure_data = await load_balancer.get_tv_structure(title)
72
  if tv_structure_data:
73
  data['file_structure'] = tv_structure_data
74
 
 
68
  data = await read_json_file(json_cache_path)
69
 
70
  # Add the file structure to the metadata
71
+ tv_structure_data = load_balancer.get_tv_structure(title)
72
  if tv_structure_data:
73
  data['file_structure'] = tv_structure_data
74
 
indexer.py CHANGED
@@ -1,4 +1,4 @@
1
- from hf_scrapper import get_file_structure, write_file_structure_to_json
2
  from dotenv import load_dotenv
3
  import os
4
 
@@ -16,7 +16,6 @@ def index_repository(token, repo, current_path=""):
16
  "contents": sub_directory_structure
17
  })
18
  else:
19
- # Exclude 'oid' and 'lfs' from the file item
20
  file_item = {
21
  "type": item['type'],
22
  "size": item['size'],
@@ -31,3 +30,5 @@ def indexer():
31
  full_structure = index_repository(token, repo, "")
32
  print(f"Full file structure for repository '{repo}' has been indexed.")
33
  return full_structure
 
 
 
1
+ from hf_scrapper import get_file_structure
2
  from dotenv import load_dotenv
3
  import os
4
 
 
16
  "contents": sub_directory_structure
17
  })
18
  else:
 
19
  file_item = {
20
  "type": item['type'],
21
  "size": item['size'],
 
30
  full_structure = index_repository(token, repo, "")
31
  print(f"Full file structure for repository '{repo}' has been indexed.")
32
  return full_structure
33
+
34
+ indexer()