Fix manga importing

This commit is contained in:
Koitharu
2025-01-11 14:37:30 +02:00
parent 749bc4a837
commit dcb92ed1af
2 changed files with 6 additions and 1 deletions

View File

@@ -279,6 +279,10 @@
<service
android:name="org.koitharu.kotatsu.local.ui.LocalIndexUpdateService"
android:label="@string/local_manga_processing" />
<service
android:name="org.koitharu.kotatsu.local.ui.ImportService"
android:foregroundServiceType="dataSync"
android:label="@string/importing_manga" />
<service
android:name="org.koitharu.kotatsu.widget.shelf.ShelfWidgetService"
android:label="@string/manga_shelf"

View File

@@ -152,7 +152,8 @@ class ImportService : CoroutineIntentService() {
private const val CHANNEL_ID = "importing"
private const val FOREGROUND_NOTIFICATION_ID = 37
fun start(context: Context, uris: Iterable<Uri>): Boolean = try {
fun start(context: Context, uris: Collection<Uri>): Boolean = try {
require(uris.isNotEmpty())
for (uri in uris) {
val intent = Intent(context, ImportService::class.java)
intent.putExtra(DATA_URI, uri.toString())