Skip to content

Commit

Permalink
fix: typo causing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
g0ldyy authored Aug 27, 2024
1 parent b111cc2 commit 7584af6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions comet/api/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ async def stream(request: Request, b64config: str, type: str, id: str):

json_data = json.dumps(sorted_ranked_files).replace("'", "''")
await database.execute(
f"INSERT {'OR IGNORE ' if settings.DATABASE_TYPE == 'sqlite' else ''}INTO cache (cacheKey, results, timestamp) VALUES (:cache_key, :json_data, :timestamp){' ON CONFLICT DO NOTHING' if settings.DATABASE_TYPE == 'postgressql' else ''}",
f"INSERT {'OR IGNORE ' if settings.DATABASE_TYPE == 'sqlite' else ''}INTO cache (cacheKey, results, timestamp) VALUES (:cache_key, :json_data, :timestamp){' ON CONFLICT DO NOTHING' if settings.DATABASE_TYPE == 'postgresql' else ''}",
{"cache_key": cache_key, "json_data": json_data, "timestamp": time.time()},
)
logger.info(f"Results have been cached for {log_name}")
Expand Down Expand Up @@ -491,7 +491,7 @@ async def playback(request: Request, b64config: str, hash: str, index: str):

# Cache the new download link
await database.execute(
f"INSERT {'OR IGNORE ' if settings.DATABASE_TYPE == 'sqlite' else ''}INTO download_links (debrid_key, hash, file_index, link, timestamp) VALUES (:debrid_key, :hash, :index, :link, :timestamp){' ON CONFLICT DO NOTHING' if settings.DATABASE_TYPE == 'postgressql' else ''}",
f"INSERT {'OR IGNORE ' if settings.DATABASE_TYPE == 'sqlite' else ''}INTO download_links (debrid_key, hash, file_index, link, timestamp) VALUES (:debrid_key, :hash, :index, :link, :timestamp){' ON CONFLICT DO NOTHING' if settings.DATABASE_TYPE == 'postgresql' else ''}",
{
"debrid_key": config["debridApiKey"],
"hash": hash,
Expand Down Expand Up @@ -565,7 +565,7 @@ async def close(self):
if response.status == 206:
id = str(uuid.uuid4())
await database.execute(
f"INSERT {'OR IGNORE ' if settings.DATABASE_TYPE == 'sqlite' else ''}INTO active_connections (id, ip, content, timestamp) VALUES (:id, :ip, :content, :timestamp){' ON CONFLICT DO NOTHING' if settings.DATABASE_TYPE == 'postgressql' else ''}",
f"INSERT {'OR IGNORE ' if settings.DATABASE_TYPE == 'sqlite' else ''}INTO active_connections (id, ip, content, timestamp) VALUES (:id, :ip, :content, :timestamp){' ON CONFLICT DO NOTHING' if settings.DATABASE_TYPE == 'postgresql' else ''}",
{
"id": id,
"ip": ip,
Expand Down

0 comments on commit 7584af6

Please sign in to comment.