Skip to content

Commit

Permalink
avoid scan in loop when name/path is null in delete_files for some re…
Browse files Browse the repository at this point in the history
…ason (seen on nvidia shield)
  • Loading branch information
courville committed Jun 20, 2024
1 parent b6a2966 commit 58ded7d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 58ded7d

Please sign in to comment.