Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deduplication of URLs does not work when adding same URL. #56

Open
pashaka opened this issue Aug 13, 2021 · 1 comment
Open

Deduplication of URLs does not work when adding same URL. #56

pashaka opened this issue Aug 13, 2021 · 1 comment

Comments

@pashaka
Copy link

pashaka commented Aug 13, 2021

Adding URL calls add_item function, which checks new URL vs item_name, but not vs url in the database.

@pashaka
Copy link
Author

pashaka commented Aug 13, 2021

Don't know how to make pull requests. But here is the fix:

--- a/functions.py
+++ b/functions.py
@@ -274,7 +274,7 @@ def add_item(name_check):
     conn = create_connection(database)
     c = conn.cursor()
     try:
-        c.execute("SELECT count(*) FROM ph_items WHERE url_name = ?", (item_name,))
+        c.execute("SELECT count(*) FROM ph_items WHERE url_name = ? and type = ? ", (item_url_name,item_type))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant