Commit e75ffd9b authored by Sébastien Toque's avatar Sébastien Toque

do not empty the DB if storage is not mounted

parent 635bf321
......@@ -249,12 +249,14 @@ public class MediaLibrary {
h.sendEmptyMessage(MEDIA_ITEMS_UPDATED);
}
// remove file from database
for (String fileURI : addedLocations) {
existingMedias.remove(fileURI);
}
for (String existingMedia : existingMedias.keySet()) {
mDBManager.removeMedia(existingMedia);
// remove file from database if storage is mounted
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
for (String fileURI : addedLocations) {
existingMedias.remove(fileURI);
}
for (String existingMedia : existingMedias.keySet()) {
mDBManager.removeMedia(existingMedia);
}
}
// hide progressbar in header
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment