From 989cf66715cd28e6a3171855a0a58e746efc935f Mon Sep 17 00:00:00 2001 From: Nicholas Wallace Date: Sun, 13 Sep 2026 15:03:15 -0700 Subject: [PATCH] Revert "Debug: add forced bad download queue entry" This reverts commit 108f34bfb7c55bddcf5f1d3da9ee8796be762787. --- .../app/plugins/AbsDownloader.kt | 83 ------------------- pages/logs.vue | 26 +----- 2 files changed, 2 insertions(+), 107 deletions(-) diff --git a/android/app/src/main/java/com/audiobookshelf/app/plugins/AbsDownloader.kt b/android/app/src/main/java/com/audiobookshelf/app/plugins/AbsDownloader.kt index aa809162..cd678a18 100644 --- a/android/app/src/main/java/com/audiobookshelf/app/plugins/AbsDownloader.kt +++ b/android/app/src/main/java/com/audiobookshelf/app/plugins/AbsDownloader.kt @@ -1,6 +1,5 @@ package com.audiobookshelf.app.plugins -import android.net.Uri import android.os.Environment import com.audiobookshelf.app.MainActivity import com.audiobookshelf.app.data.* @@ -67,88 +66,6 @@ class AbsDownloader : Plugin() { call.resolve() } - /** Writes a malformed persisted queue entry for manually testing startup recovery. */ - @PluginMethod - fun createInvalidDownloadQueueEntry(call: PluginCall) { - try { - val downloadItemId = "debug-invalid-download" - val filename = "debug-invalid-download.m4b" - val localFolder = - LocalFolder( - "internal-book", - "Internal App Storage", - "", - "", - mainActivity.filesDir.absolutePath, - "internal", - "book" - ) - val itemFolder = File(mainActivity.filesDir, "downloads/$downloadItemId") - val stagingFile = - File(mainActivity.filesDir, "download-staging/$downloadItemId/$filename.part") - val finalFile = File(itemFolder, filename) - val part = - DownloadItemPart( - id = "$downloadItemId-part", - downloadItemId = downloadItemId, - filename = filename, - fileSize = 1L, - destinationPath = stagingFile.absolutePath, - finalDestinationPath = finalFile.absolutePath, - serverPath = "/debug/invalid-download", - localFolderName = localFolder.name, - localFolderUrl = localFolder.contentUrl, - localFolderId = localFolder.id, - ebookFile = null, - audioTrack = null, - episode = null, - completed = false, - moved = false, - isMoving = false, - failed = false, - uri = Uri.parse("https://invalid.local/debug/invalid-download"), - destinationUri = Uri.fromFile(stagingFile), - finalDestinationUri = Uri.fromFile(finalFile), - completedDestinationUri = null, - finalDestinationSubfolder = downloadItemId, - downloadId = null, - lastUpdateTime = null, - progress = 0L, - bytesDownloaded = 0L - ) - - DownloadItemPart::class.java.getDeclaredField("destinationPath").apply { - isAccessible = true - set(part, null) - } - - val downloadItem = - DownloadItem( - id = downloadItemId, - libraryItemId = downloadItemId, - episodeId = null, - userMediaProgress = null, - serverConnectionConfigId = "debug", - serverAddress = "https://invalid.local", - serverUserId = "debug", - mediaType = "book", - itemFolderPath = itemFolder.absolutePath, - localFolder = localFolder, - itemTitle = "Invalid Download Queue Test", - itemSubfolder = downloadItemId, - media = MediaType(MediaTypeMetadata("Invalid Download Queue Test", false), null), - downloadItemParts = mutableListOf(part) - ) - - DeviceManager.dbManager.saveDownloadItem(downloadItem) - AbsLogger.info(tag, "Created malformed download queue entry $downloadItemId") - call.resolve() - } catch (e: Exception) { - AbsLogger.error(tag, "Could not create malformed download queue entry: ${e.message}") - call.reject("Could not create malformed download queue entry", e) - } - } - /** Replays restored queue items when the frontend subscribes to download events. */ @PluginMethod(returnType = PluginMethod.RETURN_NONE) override fun addListener(call: PluginCall) { diff --git a/pages/logs.vue b/pages/logs.vue index 1818aac4..b5db7b90 100644 --- a/pages/logs.vue +++ b/pages/logs.vue @@ -8,10 +8,6 @@ -
- Create Invalid Download Queue -
-

{{ $strings.MessageNoLogs }}

@@ -33,8 +29,7 @@
+