mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-08 18:28:53 +01:00
Only schedule a metadata task when saving to server
This commit is contained in:
parent
ddf059e609
commit
a917458a07
1 changed files with 7 additions and 3 deletions
|
@ -340,7 +340,7 @@ class ImageProcessorService : Service() {
|
||||||
)
|
)
|
||||||
cmdTask = object : ImageProcessorCommandTask(applicationContext) {
|
cmdTask = object : ImageProcessorCommandTask(applicationContext) {
|
||||||
override fun onPostExecute(result: MessageEvent) {
|
override fun onPostExecute(result: MessageEvent) {
|
||||||
notifyResult(result)
|
notifyResult(result, cmd.isSaveToServer)
|
||||||
cmds.removeFirst()
|
cmds.removeFirst()
|
||||||
stopSelf(cmd.startId)
|
stopSelf(cmd.startId)
|
||||||
cmdTask = null
|
cmdTask = null
|
||||||
|
@ -386,9 +386,13 @@ class ImageProcessorService : Service() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun notifyResult(event: MessageEvent) {
|
private fun notifyResult(event: MessageEvent, shouldFireEvent: Boolean) {
|
||||||
if (event is ImageProcessorCompletedEvent) {
|
if (event is ImageProcessorCompletedEvent) {
|
||||||
NativeEventChannelHandler.fire(ImageProcessorUploadSuccessEvent())
|
if (shouldFireEvent) {
|
||||||
|
NativeEventChannelHandler.fire(
|
||||||
|
ImageProcessorUploadSuccessEvent()
|
||||||
|
)
|
||||||
|
}
|
||||||
notificationManager.notify(
|
notificationManager.notify(
|
||||||
RESULT_NOTIFICATION_ID, buildResultNotification(event.result)
|
RESULT_NOTIFICATION_ID, buildResultNotification(event.result)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue