22import os
33
44from src .back .system .history import History as his
5+ from src .back .system .settings import Settings
56
67# main reason why this is here:
78# 1. catbox for some reason need this
@@ -24,7 +25,8 @@ def catbox(file_path):
2425 if response .status_code == 200 :
2526 result = response .text .strip ()
2627 if result :
27- his ().storeHistory ("catbox" , os .path .basename (file_path ), result , "" )
28+ if Settings ().readSet ._history ():
29+ his ().storeHistory ("catbox" , os .path .basename (file_path ), result , "" )
2830 return result
2931 return "Error: Server returned empty response."
3032 return f"Server Error: { response .status_code } "
@@ -43,7 +45,8 @@ def litterbox(file_path, duration="1h"):
4345 if response .status_code == 200 :
4446 result = response .text .strip ()
4547 if result :
46- his ().storeHistory ("litterbox" , os .path .basename (file_path ), result , duration )
48+ if Settings ().readSet ._history ():
49+ his ().storeHistory ("litterbox" , os .path .basename (file_path ), result , duration )
4750 return result
4851 return "Error: Server returned empty response."
4952 return f"Server Error: { response .status_code } "
@@ -61,7 +64,8 @@ def buzzheavier(file_path):
6164 data = response .json ()
6265 fileID = data .get ("data" , {}).get ("id" )
6366 if fileID :
64- his ().storeHistory ("buzzheavier" , filename , f"https://buzzheavier.com/{ fileID } " , "" )
67+ if Settings ().readSet ._history ():
68+ his ().storeHistory ("buzzheavier" , filename , f"https://buzzheavier.com/{ fileID } " , "" )
6569 return f"https://buzzheavier.com/{ fileID } "
6670 return "Error: Could not find file ID in response."
6771 return f"Server Error: { response .status_code } "
0 commit comments