Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -800,14 +800,14 @@ def roadmap():
|
|
800 |
# temp1.append({'viewed': False, 'type': 'video', 'videoId': vid['id']['videoId'], 'videoTitle': vid['snippet']['title'], 'channelName': vid['snippet']['channelTitle'], 'thumbnail': vid['snippet']['thumbnails']['high']['url']})
|
801 |
|
802 |
# ele[f"week{index + 1}"]['data'][f"day{i+1}"]['youtube'] = temp1
|
803 |
-
|
804 |
|
805 |
# Reference Links
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
|
810 |
-
|
811 |
|
812 |
# else:
|
813 |
# print("Error:", response.json())
|
@@ -850,7 +850,6 @@ def roadmap():
|
|
850 |
@auth_user
|
851 |
def roadmapGetHistory():
|
852 |
userId = request.userId
|
853 |
-
print(userId)
|
854 |
try:
|
855 |
results = roadmap_collection.find({"userId": userId}, {"_id": 1, "title": 1, "activeDays": 1}).limit(5)
|
856 |
roadmaps = [{"_id": str(result["_id"]), "title": result["title"], "activeDays": result["activeDays"]} for result in results]
|
|
|
800 |
# temp1.append({'viewed': False, 'type': 'video', 'videoId': vid['id']['videoId'], 'videoTitle': vid['snippet']['title'], 'channelName': vid['snippet']['channelTitle'], 'thumbnail': vid['snippet']['thumbnails']['high']['url']})
|
801 |
|
802 |
# ele[f"week{index + 1}"]['data'][f"day{i+1}"]['youtube'] = temp1
|
803 |
+
ele[f"week{index + 1}"]['data'][f"day{i+1}"]['youtube'] = []
|
804 |
|
805 |
# Reference Links
|
806 |
+
temp2 = []
|
807 |
+
for link in ele[f"week{index + 1}"]['data'][f"day{i+1}"]['links']:
|
808 |
+
temp2.append({'link': link, 'visited': False})
|
809 |
|
810 |
+
ele[f"week{index + 1}"]['data'][f"day{i+1}"]['links'] = temp2
|
811 |
|
812 |
# else:
|
813 |
# print("Error:", response.json())
|
|
|
850 |
@auth_user
|
851 |
def roadmapGetHistory():
|
852 |
userId = request.userId
|
|
|
853 |
try:
|
854 |
results = roadmap_collection.find({"userId": userId}, {"_id": 1, "title": 1, "activeDays": 1}).limit(5)
|
855 |
roadmaps = [{"_id": str(result["_id"]), "title": result["title"], "activeDays": result["activeDays"]} for result in results]
|