Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb46d060 authored by Mike Lockwood's avatar Mike Lockwood
Browse files

MediaScanner: No longer delete playlist files that have no valid entries



When copying files from MTP we must keep the file in the database, even
if we cannot find any of the playlist entries (or even if it is not a valid playlist file)

BUG: 3260341

Change-Id: I4b39027ee25ffae6778224cf74830a4b1ca3fecb
Signed-off-by: default avatarMike Lockwood <lockwood@android.com>
parent 7400be47
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -1494,17 +1494,6 @@ public class MediaScanner
        } else if (fileType == MediaFile.FILE_TYPE_WPL) {
            processWplPlayList(path, playListDirectory, membersUri);
        }

        Cursor cursor = mMediaProvider.query(membersUri, PLAYLIST_MEMBERS_PROJECTION, null,
                null, null);
        try {
            if (cursor == null || cursor.getCount() == 0) {
                Log.d(TAG, "playlist is empty - deleting");
                mMediaProvider.delete(uri, null, null);
            }
        } finally {
            if (cursor != null) cursor.close();
        }
    }

    private void processPlayLists() throws RemoteException {