mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-02 06:46:22 +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) {
|
||||
override fun onPostExecute(result: MessageEvent) {
|
||||
notifyResult(result)
|
||||
notifyResult(result, cmd.isSaveToServer)
|
||||
cmds.removeFirst()
|
||||
stopSelf(cmd.startId)
|
||||
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) {
|
||||
NativeEventChannelHandler.fire(ImageProcessorUploadSuccessEvent())
|
||||
if (shouldFireEvent) {
|
||||
NativeEventChannelHandler.fire(
|
||||
ImageProcessorUploadSuccessEvent()
|
||||
)
|
||||
}
|
||||
notificationManager.notify(
|
||||
RESULT_NOTIFICATION_ID, buildResultNotification(event.result)
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue