…lines 1–76 unchanged (76 lines)
77 }
78
79 Log_OC.d(TAG, "🕒 started for ${user.accountName} downloading ${folder.fileName}")
80
81 trySetForeground(folder)
82
83 folderDownloadEventBroadcaster.sendDownloadEnqueued(folder.fileId)
84 pendingDownloads.add(folder.fileId)
85
86 val downloadHelper = FileDownloadHelper.instance()
87
88 return withContext(Dispatchers.IO) {
89 try {
…lines 90–134 unchanged (45 lines)
135 Result.failure()
136 }
137 } catch (e: Exception) {
138 Log_OC.d(TAG, "❌ failed reason: $e")
139 Result.failure()
140 } finally {
141 folderDownloadEventBroadcaster.sendDownloadCompleted(folder.fileId)
142 pendingDownloads.remove(folder.fileId)
143 notificationManager.dismiss()
144 }
145 }
146 }
147
…lines 148–203 unchanged (56 lines)