Skip to content

Conversation

deldesir
Copy link
Collaborator

@deldesir deldesir commented Feb 8, 2024

🚀 Pull Request Overview:

This PR checks whether column error exists or not using the PRAGMA table_info(media) statement. This statement retrieves information about the columns in the "media" table. Column "error won't exist if xklb-metadata.db is created by the current run/session. In this case, the first error will be a TypeError and reported as such. If xklb-metadata.db exists prior the run/session, meaningful errors are retrieved from error column instead.

NB This PR is a rework of #122, ensuring new valid downloads will not fail when an invalid URL was submitted in a previous session.

📋 Checklist:

  • Tested the changes thoroughly.

🐛 Related issue(s): #114, #120

📌 Testing scenarios:

  • Submit a membership-only or a live URL
  • Observe the NoneType Error
  • Submit a valid URL
  • Observe the successful download without an additional attempt to download the previous failed URL

cc @EMG70

This prevents failure when xklb-metadata.db is just created.
@deldesir deldesir added bug Something isn't working enhancement New feature or request labels Feb 8, 2024
@deldesir deldesir requested a review from holta February 8, 2024 08:31
@deldesir deldesir self-assigned this Feb 8, 2024
@deldesir
Copy link
Collaborator Author

deldesir commented Feb 8, 2024

Tested on new Ubuntu 24.04 VM like this:

  1. I submit a membership-only URL, then submit the same membership-only URL again to ensure retrieving a more meaningful error is returned
    Screenshot_20240208_030100

  2. I submit a valid URL to ensure no failed URL is included in the new download
    Screenshot_20240208_030257-1

@deldesir deldesir changed the title Enhance fail-safe mechanism in new downloads when an invalid URL was submitted in a previous session Ensure fail-safe downloads when an invalid URL was submitted in a previous session Feb 8, 2024
@holta holta merged commit 401dd17 into iiab:master Feb 8, 2024
@deldesir deldesir deleted the deldesir-patch-8 branch July 1, 2024 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants