From aa7d42a2113f17d2f3a1c3d7933f68fce75b463e Mon Sep 17 00:00:00 2001 From: Niels van Velzen Date: Wed, 7 May 2025 22:15:07 +0200 Subject: [PATCH] Implement DownloadManagement app feature in nativeshell --- app/src/main/assets/native/nativeshell.js | 19 ++++++++++++------- .../jellyfin/mobile/bridge/NativeInterface.kt | 5 +++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/src/main/assets/native/nativeshell.js b/app/src/main/assets/native/nativeshell.js index 21ea0987..095cc5cb 100644 --- a/app/src/main/assets/native/nativeshell.js +++ b/app/src/main/assets/native/nativeshell.js @@ -1,18 +1,19 @@ const features = [ - "filedownload", + "castmenuhashchange" + "clientsettings", "displaylanguage", - "subtitleappearancesettings", - "subtitleburnsettings", - //'sharing', + "downloadmanagement", "exit", + "externallinks", + "filedownload", "htmlaudioautoplay", "htmlvideoautoplay", - "externallinks", - "clientsettings", "multiserver", "physicalvolumecontrol", "remotecontrol", - "castmenuhashchange" + "subtitleappearancesettings", + "subtitleburnsettings", +// 'sharing' ]; const plugins = [ @@ -67,6 +68,10 @@ window.NativeShell = { window.NativeInterface.downloadFiles(JSON.stringify(downloadInfo)); }, + openDownloadManager() { + window.NativeInterface.openDownloadManager(); + }, + openClientSettings() { window.NativeInterface.openClientSettings(); }, diff --git a/app/src/main/java/org/jellyfin/mobile/bridge/NativeInterface.kt b/app/src/main/java/org/jellyfin/mobile/bridge/NativeInterface.kt index 15685ab3..ba1f843d 100644 --- a/app/src/main/java/org/jellyfin/mobile/bridge/NativeInterface.kt +++ b/app/src/main/java/org/jellyfin/mobile/bridge/NativeInterface.kt @@ -144,6 +144,11 @@ class NativeInterface(private val context: Context) : KoinComponent { return true } + @JavascriptInterface + fun openDownloadManager() { + emitEvent(ActivityEvent.OpenDownloads) + } + @JavascriptInterface fun openClientSettings() { emitEvent(ActivityEvent.OpenSettings)