pull/653/merge
Varun Patil 2023-10-01 19:14:43 -07:00
parent 73ff1b883f
commit 4e90123814
1 changed files with 3 additions and 6 deletions

View File

@ -108,9 +108,8 @@ import java.util.concurrent.CountDownLatch
fun getSystemImagesByAUIDs(auids: List<Long>): List<SystemImage> { fun getSystemImagesByAUIDs(auids: List<Long>): List<SystemImage> {
val photos = mPhotoDao.getPhotosByAUIDs(auids) val photos = mPhotoDao.getPhotosByAUIDs(auids)
val fileIds = photos.map { it.localId } if (photos.isEmpty()) return listOf()
if (fileIds.isEmpty()) return listOf() return SystemImage.getByIds(mCtx, photos.map { it.localId })
return SystemImage.getByIds(mCtx, fileIds)
} }
@Throws(JSONException::class) @Throws(JSONException::class)
@ -181,9 +180,7 @@ import java.util.concurrent.CountDownLatch
@Throws(Exception::class) @Throws(Exception::class)
fun delete(auids: List<Long>, dry: Boolean): JSONObject { fun delete(auids: List<Long>, dry: Boolean): JSONObject {
synchronized(this) { synchronized(this) {
if (deleting) { if (deleting) throw Exception("Already deleting another set of images")
throw Exception("Already deleting another set of images")
}
deleting = true deleting = true
} }