From 58ded7dc8ea4d285c17d8278070882d8ba68a62f Mon Sep 17 00:00:00 2001 From: Courville Software Date: Thu, 20 Jun 2024 22:23:42 +0200 Subject: [PATCH] avoid scan in loop when name/path is null in delete_files for some reason (seen on nvidia shield) --- .../archos/mediaprovider/video/VideoStoreImportService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/archos/mediaprovider/video/VideoStoreImportService.java b/src/com/archos/mediaprovider/video/VideoStoreImportService.java index 4e12b2f1..3e5ddcbf 100644 --- a/src/com/archos/mediaprovider/video/VideoStoreImportService.java +++ b/src/com/archos/mediaprovider/video/VideoStoreImportService.java @@ -510,7 +510,7 @@ private void processDeleteFileAndVobCallback() { // note that the db is being modified during import while (true) { try { - c = db.rawQuery("SELECT * FROM delete_files WHERE name IN (SELECT cover_movie FROM MOVIE UNION SELECT cover_show FROM SHOW UNION SELECT cover_episode FROM EPISODE) ORDER BY " + BaseColumns._ID + " ASC LIMIT " + WINDOW_SIZE, null); + c = db.rawQuery("SELECT * FROM delete_files WHERE name IS NOT NULL AND name IN (SELECT cover_movie FROM MOVIE UNION SELECT cover_show FROM SHOW UNION SELECT cover_episode FROM EPISODE) ORDER BY " + BaseColumns._ID + " ASC LIMIT " + WINDOW_SIZE, null); cCount = c.getCount(); log.debug("processDeleteFileAndVobCallback: delete_files cover_movie new batch fetching window=" + WINDOW_SIZE + " -> cursor has size " + cCount); if (cCount == 0) { @@ -543,7 +543,7 @@ private void processDeleteFileAndVobCallback() { // note that the db is being modified during import while (true) { try { - c = db.rawQuery("SELECT * FROM delete_files ORDER BY " + BaseColumns._ID + " ASC LIMIT " + WINDOW_SIZE, null); + c = db.rawQuery("SELECT * FROM delete_files WHERE name IS NOT NULL ORDER BY " + BaseColumns._ID + " ASC LIMIT " + WINDOW_SIZE, null); cCount = c.getCount(); log.debug("processDeleteFileAndVobCallback: delete_files new batch fetching window=" + WINDOW_SIZE + " -> cursor has size " + cCount); if (cCount == 0) {