Update engine.py
This commit is contained in:
10
engine.py
10
engine.py
@@ -417,3 +417,13 @@ class SorterEngine:
|
|||||||
pass
|
pass
|
||||||
finally:
|
finally:
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def delete_category(name):
|
||||||
|
"""Deletes a category and clears any staged tags associated with it."""
|
||||||
|
conn = sqlite3.connect(SorterEngine.DB_PATH)
|
||||||
|
cursor = conn.cursor()
|
||||||
|
cursor.execute("DELETE FROM categories WHERE name = ?", (name,))
|
||||||
|
cursor.execute("DELETE FROM staging_area WHERE target_category = ?", (name,))
|
||||||
|
conn.commit()
|
||||||
|
conn.close()
|
||||||
Reference in New Issue
Block a user