diff --git a/android/app/src/main/java/com/audiobookshelf/app/managers/DownloadItemManager.kt b/android/app/src/main/java/com/audiobookshelf/app/managers/DownloadItemManager.kt index fc5a8c3a..fbf741e3 100644 --- a/android/app/src/main/java/com/audiobookshelf/app/managers/DownloadItemManager.kt +++ b/android/app/src/main/java/com/audiobookshelf/app/managers/DownloadItemManager.kt @@ -375,6 +375,7 @@ class DownloadItemManager( throw IllegalStateException("Could not finalize internal staging file") } backup.delete() + AbsLogger.info(tag, "Move completed for ${part.filename} to ${finalFile.absolutePath}") completePart(item, part) } catch (e: Exception) { part.isMoving = false @@ -423,6 +424,7 @@ class DownloadItemManager( throw IllegalStateException("SAF final size mismatch") if (!staging.delete()) AbsLogger.error(tag, "Could not remove staging file ${staging.name}") part.completedDestinationUri = destination.uri.toString() + AbsLogger.info(tag, "Move completed for ${part.filename} to ${destination.uri}") completePart(item, part) } catch (e: Exception) { failFinalization(item, part, "SAF copy failed: ${e.message}") diff --git a/android/app/src/main/java/com/audiobookshelf/app/managers/InternalDownloadManager.kt b/android/app/src/main/java/com/audiobookshelf/app/managers/InternalDownloadManager.kt index 5aec3965..a8994653 100644 --- a/android/app/src/main/java/com/audiobookshelf/app/managers/InternalDownloadManager.kt +++ b/android/app/src/main/java/com/audiobookshelf/app/managers/InternalDownloadManager.kt @@ -66,6 +66,7 @@ class InternalDownloadManager( "Starting ${if (existingBytes > 0L) "resumed" else "new"} download for ${destinationFile.name} at byte $existingBytes") if (expectedSize > 0L && existingBytes == expectedSize) { progressCallback.onProgress(existingBytes, 100L) + AbsLogger.info(tag, "Download completed for ${destinationFile.name} ($existingBytes bytes)") progressCallback.onComplete(false) return } @@ -103,6 +104,7 @@ class InternalDownloadManager( ?.toLongOrNull() if (serverSize != null && serverSize > 0L && existingBytes == serverSize) { progressCallback.onProgress(existingBytes, 100L) + AbsLogger.info(tag, "Download completed for ${destinationFile.name} ($existingBytes bytes)") progressCallback.onComplete(false) } else if (allowRestart && destinationFile.delete()) { AbsLogger.info(tag, "Restarting stale range from byte zero for ${destinationFile.name}") @@ -162,6 +164,10 @@ class InternalDownloadManager( ) progressCallback.onComplete(true) } else { + AbsLogger.info( + tag, + "Download completed for ${destinationFile.name} (${destinationFile.length()} bytes)" + ) progressCallback.onComplete(false) } } catch (e: IOException) { diff --git a/ios/App/App/plugins/AbsDownloader.swift b/ios/App/App/plugins/AbsDownloader.swift index 37f0a80c..19df4f93 100644 --- a/ios/App/App/plugins/AbsDownloader.swift +++ b/ios/App/App/plugins/AbsDownloader.swift @@ -78,6 +78,7 @@ public class AbsDownloader: CAPPlugin, CAPBridgedPlugin, URLSessionDownloadDeleg liveDownloadItemPart.progress = 100 liveDownloadItemPart.completed = true } + AbsLogger.info(message: "Download completed for \(liveDownloadItemPart.filename ?? partId)") do { // Move the downloaded file into place @@ -89,6 +90,7 @@ public class AbsDownloader: CAPPlugin, CAPBridgedPlugin, URLSessionDownloadDeleg try realm.write { liveDownloadItemPart.moved = true } + AbsLogger.info(message: "Move completed for \(liveDownloadItemPart.filename ?? partId) to \(destinationUrl.path)") } catch { try realm.write { liveDownloadItemPart.failed = true