From 312e793fb2ffb9317cc8a0d8d9baf228e9c73b42 Mon Sep 17 00:00:00 2001 From: alperozturk Date: Tue, 3 Dec 2024 14:50:36 +0100 Subject: [PATCH] fix add operation Signed-off-by: alperozturk --- .../client/assistant/extensions/TaskExtensions.kt | 2 +- .../assistant/taskTypes/model/AssistantTaskType.kt | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/nextcloud/client/assistant/extensions/TaskExtensions.kt b/app/src/main/java/com/nextcloud/client/assistant/extensions/TaskExtensions.kt index bdb00c20a0..845e410ab8 100644 --- a/app/src/main/java/com/nextcloud/client/assistant/extensions/TaskExtensions.kt +++ b/app/src/main/java/com/nextcloud/client/assistant/extensions/TaskExtensions.kt @@ -53,7 +53,7 @@ fun Task.getModifiedAtRepresentation(context: Context): String? { val timeDifferenceInHours = (timeDifference / 3600) return when { - timeDifference == 0 -> { + timeDifference < 0 -> { context.getString(R.string.common_now) } diff --git a/app/src/main/java/com/nextcloud/client/assistant/taskTypes/model/AssistantTaskType.kt b/app/src/main/java/com/nextcloud/client/assistant/taskTypes/model/AssistantTaskType.kt index 1bfc3c3079..2da8192465 100644 --- a/app/src/main/java/com/nextcloud/client/assistant/taskTypes/model/AssistantTaskType.kt +++ b/app/src/main/java/com/nextcloud/client/assistant/taskTypes/model/AssistantTaskType.kt @@ -7,6 +7,7 @@ package com.nextcloud.client.assistant.taskTypes.model +import com.owncloud.android.lib.resources.assistant.model.TaskIds import com.owncloud.android.lib.resources.assistant.model.TaskTypes data class AssistantTaskType( @@ -17,12 +18,9 @@ data class AssistantTaskType( fun TaskTypes.toAssistantTaskTypeList(): List { return arrayListOf().apply { - add(AssistantTaskType("core:text2text", types.coreText2text.name, types.coreText2text.description)) - add(AssistantTaskType("core:text2text:topics", types.coreText2textTopics.name, types.coreText2textTopics.description)) - add(AssistantTaskType("core:text2text:headline", types.coreText2textHeadline.name, types.coreText2textHeadline.description)) - add(AssistantTaskType("core:text2text:summary", types.coreText2textSummary.name, types.coreText2textSummary.description)) - add(AssistantTaskType("core:text2text:translate", types.coreText2textTranslate.name, types.coreText2textTranslate.description)) - add(AssistantTaskType("core:contextwrite", types.coreContextwrite.name, types.coreContextwrite.description)) - add(AssistantTaskType("context_chat:context_chat", types.contextChatContextChat.name, types.contextChatContextChat.description)) + add(AssistantTaskType(TaskIds.GenerateText.id, types.generateText.name, types.generateText.description)) + add(AssistantTaskType(TaskIds.ExtractTopics.id, types.extractTopics.name, types.extractTopics.description)) + add(AssistantTaskType(TaskIds.GenerateHeadline.id, types.generateHeadline.name, types.generateHeadline.description)) + add(AssistantTaskType(TaskIds.Summarize.id, types.summarize.name, types.summarize.description)) } }