Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Try and fix history for conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules-WinnfieldX committed Apr 8, 2024
1 parent 32a77e1 commit 294bb2a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cyberdrop_dl/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "5.2.24"
__version__ = "5.2.25"
9 changes: 6 additions & 3 deletions cyberdrop_dl/utils/database/tables/history_table.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from sqlite3 import Row
from sqlite3 import Row, IntegrityError

import aiosqlite
from typing import TYPE_CHECKING, Iterable, Any
Expand Down Expand Up @@ -100,8 +100,11 @@ async def insert_incompleted(self, domain: str, media_item: MediaItem) -> None:
domain = await get_db_domain(domain)
url_path = await get_db_path(media_item.url, str(media_item.referer))
download_filename = media_item.download_filename if isinstance(media_item.download_filename, str) else ""
await self.db_conn.execute("""UPDATE media SET domain = ?, album_id = ? WHERE domain = 'no_crawler' and url_path = ? and referer = ?""",
(domain, media_item.album_id, url_path, str(media_item.referer)))
try:
await self.db_conn.execute("""UPDATE media SET domain = ?, album_id = ? WHERE domain = 'no_crawler' and url_path = ? and referer = ?""",
(domain, media_item.album_id, url_path, str(media_item.referer)))
except IntegrityError:
await self.db_conn.execute("""DELETE FROM media WHERE domain = 'no_crawler' and url_path = ?""", (url_path,))
await self.db_conn.execute("""INSERT OR IGNORE INTO media (domain, url_path, referer, album_id, download_path, download_filename, original_filename, completed) VALUES (?, ?, ?, ?, ?, ?, ?, ?)""",
(domain, url_path, str(media_item.referer), media_item.album_id, str(media_item.download_folder), download_filename, media_item.original_filename, 0))
await self.db_conn.execute("""UPDATE media SET download_filename = ? WHERE domain = ? and url_path = ?""",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cyberdrop-dl"
version = "5.2.24"
version = "5.2.25"
description = "Bulk downloader for multiple file hosts"
authors = ["Jules Winnfield <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 294bb2a

Please sign in to comment.