Spaces:
Running
Running
BinaryONe
commited on
Commit
·
c0a2997
1
Parent(s):
241aade
Changes in Database
Browse files
FileStream/Database/database.py
CHANGED
@@ -98,7 +98,7 @@ class Database:
|
|
98 |
async def add_file(self, file_info:dict, db_type:str):
|
99 |
file_info["time"] = Time_ISTKolNow()
|
100 |
if db_type =="PUBLIC":
|
101 |
-
fetch_old = await self.get_file_by_fileuniqueid(file_info["user_id"], file_info['file']["file_unique_id"],
|
102 |
if fetch_old:
|
103 |
return fetch_old["_id"]
|
104 |
await self.count_links(file_info["user_id"], "+")
|
@@ -106,7 +106,7 @@ class Database:
|
|
106 |
elif db_type=="PRIVATE":
|
107 |
pass
|
108 |
elif db_type == "TEMPORARY":
|
109 |
-
fetch_old = await self.get_file_by_fileuniqueid(file_info["user_id"], file_info['file']["file_unique_id"],
|
110 |
if fetch_old:
|
111 |
return fetch_old["_id"]
|
112 |
await self.count_links(file_info["user_id"], "+")
|
|
|
98 |
async def add_file(self, file_info:dict, db_type:str):
|
99 |
file_info["time"] = Time_ISTKolNow()
|
100 |
if db_type =="PUBLIC":
|
101 |
+
fetch_old = await self.get_file_by_fileuniqueid(file_info["user_id"], file_info['file']["file_unique_id"], privacy_type="PUBLIC")
|
102 |
if fetch_old:
|
103 |
return fetch_old["_id"]
|
104 |
await self.count_links(file_info["user_id"], "+")
|
|
|
106 |
elif db_type=="PRIVATE":
|
107 |
pass
|
108 |
elif db_type == "TEMPORARY":
|
109 |
+
fetch_old = await self.get_file_by_fileuniqueid(file_info["user_id"], file_info['file']["file_unique_id"], privacy_type="TEMPORARY")
|
110 |
if fetch_old:
|
111 |
return fetch_old["_id"]
|
112 |
await self.count_links(file_info["user_id"], "+")
|