diff --git a/cps/tasks/metadata_extract.py b/cps/tasks/metadata_extract.py index 4f6ec53e96..e0f0f6bc40 100644 --- a/cps/tasks/metadata_extract.py +++ b/cps/tasks/metadata_extract.py @@ -56,6 +56,10 @@ def _execute_subprocess(self, subprocess_args): self.message = f"{self.media_url_link} failed: {e}" return None + def _remove_shorts_from_db(self, conn): + conn.execute("DELETE FROM media WHERE path LIKE '%shorts%'") + conn.commit() + def _fetch_requested_urls(self, conn): try: cursor = conn.execute("PRAGMA table_info(media)") @@ -160,6 +164,7 @@ def run(self, worker_thread): return with sqlite3.connect(XKLB_DB_FILE) as conn: + self._remove_shorts_from_db(conn) requested_urls = self._fetch_requested_urls(conn) if not requested_urls: return