mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-05-01 15:14:29 +02:00
Allow import/restore playlist with missing sources
This commit is contained in:
parent
182c88fc9e
commit
73321ee362
@ -607,6 +607,7 @@ class MainActivity : AppCompatActivity, IWithResultLauncher {
|
|||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
val name = when(type) {
|
val name = when(type) {
|
||||||
"Playlist" -> recon.split("\n").filter { !it.startsWith(ManagedStore.RECONSTRUCTION_HEADER_OPERATOR) }.firstOrNull() ?: type;
|
"Playlist" -> recon.split("\n").filter { !it.startsWith(ManagedStore.RECONSTRUCTION_HEADER_OPERATOR) }.firstOrNull() ?: type;
|
||||||
else -> type
|
else -> type
|
||||||
|
@ -5,6 +5,7 @@ import android.net.Uri
|
|||||||
import androidx.core.content.FileProvider
|
import androidx.core.content.FileProvider
|
||||||
import com.futo.platformplayer.R
|
import com.futo.platformplayer.R
|
||||||
import com.futo.platformplayer.api.media.PlatformID
|
import com.futo.platformplayer.api.media.PlatformID
|
||||||
|
import com.futo.platformplayer.api.media.exceptions.NoPlatformClientException
|
||||||
import com.futo.platformplayer.api.media.models.channels.IPlatformChannel
|
import com.futo.platformplayer.api.media.models.channels.IPlatformChannel
|
||||||
import com.futo.platformplayer.api.media.models.contents.IPlatformContent
|
import com.futo.platformplayer.api.media.models.contents.IPlatformContent
|
||||||
import com.futo.platformplayer.api.media.models.video.IPlatformVideo
|
import com.futo.platformplayer.api.media.models.video.IPlatformVideo
|
||||||
@ -265,6 +266,11 @@ class StatePlaylists {
|
|||||||
builder.messages.add("${name}:[${it}] is no longer available");
|
builder.messages.add("${name}:[${it}] is no longer available");
|
||||||
return@map null;
|
return@map null;
|
||||||
}
|
}
|
||||||
|
catch(ex: NoPlatformClientException) {
|
||||||
|
//TODO: Propagate this to dialog, and then back, allowing users to enable plugins...
|
||||||
|
builder.messages.add("No source enabled for [${it}]");
|
||||||
|
return@map null;
|
||||||
|
}
|
||||||
catch(ex: Throwable) {
|
catch(ex: Throwable) {
|
||||||
throw ReconstructionException(name, "${name}:[${it}] ${ex.message}", ex);
|
throw ReconstructionException(name, "${name}:[${it}] ${ex.message}", ex);
|
||||||
}
|
}
|
||||||
|
@ -118,6 +118,7 @@ class ManagedStore<T>{
|
|||||||
val builder = ReconstructStore.Builder();
|
val builder = ReconstructStore.Builder();
|
||||||
|
|
||||||
for (recon in items) {
|
for (recon in items) {
|
||||||
|
onProgress?.invoke(0, total);
|
||||||
//Retry once
|
//Retry once
|
||||||
for (i in 0 .. 1) {
|
for (i in 0 .. 1) {
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user