From b4332eef9b16ba3cc18a8ffaa9614ed064f1d090 Mon Sep 17 00:00:00 2001 From: bpawnzZ Date: Thu, 26 Dec 2024 13:16:17 -0500 Subject: [PATCH 1/3] hash-db-error-fix --- .gitignore | 2 ++ cyberdrop_dl/utils/transfer/transfer_hash_db.py | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e53487635..1196108b2 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ venv # MacOS system files **.DS_Store +.aider* +.env diff --git a/cyberdrop_dl/utils/transfer/transfer_hash_db.py b/cyberdrop_dl/utils/transfer/transfer_hash_db.py index f98950a59..5c819f90b 100644 --- a/cyberdrop_dl/utils/transfer/transfer_hash_db.py +++ b/cyberdrop_dl/utils/transfer/transfer_hash_db.py @@ -11,7 +11,6 @@ console = Console() - def transfer_from_old_hash_table(db_path): """Transfers data from the old 'hash' table to new 'files' and 'temp_hash' tables, handling potential schema differences and errors. @@ -23,6 +22,14 @@ def transfer_from_old_hash_table(db_path): """ with db_transfer_context(db_path) as cursor: + # Check if the 'hash' table exists + cursor.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='hash'") + hash_table_exists = cursor.fetchone() is not None + + if not hash_table_exists: + console.print("[bold yellow]Old 'hash' table not found. Skipping transfer.[/]") + return + # Check if the 'hash_type' column exists in the 'hash' table cursor.execute("SELECT COUNT(*) FROM pragma_table_info('hash') WHERE name='hash_type'") has_hash_type_column = (cursor.fetchone())[0] > 0 From 4d63b670c21209a43f8de21a4392a5e9d64d27ba Mon Sep 17 00:00:00 2001 From: "Your Name (aider)" Date: Thu, 26 Dec 2024 15:25:47 -0500 Subject: [PATCH 2/3] ci: Add GitHub workflow for building and publishing packages --- .github/workflows/publish.yml | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..954e9d548 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,38 @@ +name: Publish Package to GitHub Packages + +on: + push: + branches: + - main + release: + types: [created] + +jobs: + build-and-publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v3 + + - name: Set up environment + uses: actions/setup-node@v3 + with: + node-version: '16' + registry-url: 'https://npm.pkg.github.com' + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + - name: Build package + run: npm run build + + - name: Publish package + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 072de2eb5338a47fc49556285a4b4e55a13bb5a7 Mon Sep 17 00:00:00 2001 From: datawhores <67020411+datawhores@users.noreply.github.com> Date: Sun, 5 Jan 2025 13:50:05 -0600 Subject: [PATCH 3/3] Delete .github/workflows/publish.yml --- .github/workflows/publish.yml | 38 ----------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 954e9d548..000000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Publish Package to GitHub Packages - -on: - push: - branches: - - main - release: - types: [created] - -jobs: - build-and-publish: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - uses: actions/checkout@v3 - - - name: Set up environment - uses: actions/setup-node@v3 - with: - node-version: '16' - registry-url: 'https://npm.pkg.github.com' - - - name: Install dependencies - run: npm ci - - - name: Run tests - run: npm test - - - name: Build package - run: npm run build - - - name: Publish package - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}