Switch full load to AUID

pull/653/merge
Varun Patil 2023-09-30 14:47:56 -07:00
parent f5daa0e557
commit 12d5f137da
2 changed files with 8 additions and 3 deletions

View File

@ -219,7 +219,7 @@ import java.net.URLDecoder
} else if (path.matches(API.IMAGE_PREVIEW)) { } else if (path.matches(API.IMAGE_PREVIEW)) {
makeResponse(image.getPreview(parts[3].toLong()), "image/jpeg") makeResponse(image.getPreview(parts[3].toLong()), "image/jpeg")
} else if (path.matches(API.IMAGE_FULL)) { } else if (path.matches(API.IMAGE_FULL)) {
makeResponse(image.getFull(parts[3].toLong()), "image/jpeg") makeResponse(image.getFull(query, parts[3].toLong()), "image/jpeg")
} else if (path.matches(API.SHARE_URL)) { } else if (path.matches(API.SHARE_URL)) {
makeResponse(dlService!!.shareUrl(URLDecoder.decode(parts[4], "UTF-8"))) makeResponse(dlService!!.shareUrl(URLDecoder.decode(parts[4], "UTF-8")))
} else if (path.matches(API.SHARE_BLOB)) { } else if (path.matches(API.SHARE_BLOB)) {

View File

@ -37,8 +37,13 @@ class ImageService(private val mCtx: Context) {
} }
@Throws(Exception::class) @Throws(Exception::class)
fun getFull(id: Long): ByteArray { fun getFull(query: TimelineQuery, auid: Long): ByteArray {
val uri = ContentUris.withAppendedId(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, id) val sysImgs = query.getSystemImagesByAUIDs(listOf(auid))
if (sysImgs.isEmpty()) {
throw Exception("Image not found")
}
val uri = sysImgs[0].uri
val bitmap = val bitmap =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {