mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-20 03:24:50 +00:00
Allow import/restore playlist with missing sources
This commit is contained in:
parent
182c88fc9e
commit
73321ee362
3 changed files with 8 additions and 0 deletions
|
@ -607,6 +607,7 @@ class MainActivity : AppCompatActivity, IWithResultLauncher {
|
|||
return;
|
||||
};
|
||||
};
|
||||
|
||||
val name = when(type) {
|
||||
"Playlist" -> recon.split("\n").filter { !it.startsWith(ManagedStore.RECONSTRUCTION_HEADER_OPERATOR) }.firstOrNull() ?: type;
|
||||
else -> type
|
||||
|
|
|
@ -5,6 +5,7 @@ import android.net.Uri
|
|||
import androidx.core.content.FileProvider
|
||||
import com.futo.platformplayer.R
|
||||
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.contents.IPlatformContent
|
||||
import com.futo.platformplayer.api.media.models.video.IPlatformVideo
|
||||
|
@ -265,6 +266,11 @@ class StatePlaylists {
|
|||
builder.messages.add("${name}:[${it}] is no longer available");
|
||||
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) {
|
||||
throw ReconstructionException(name, "${name}:[${it}] ${ex.message}", ex);
|
||||
}
|
||||
|
|
|
@ -118,6 +118,7 @@ class ManagedStore<T>{
|
|||
val builder = ReconstructStore.Builder();
|
||||
|
||||
for (recon in items) {
|
||||
onProgress?.invoke(0, total);
|
||||
//Retry once
|
||||
for (i in 0 .. 1) {
|
||||
try {
|
||||
|
|
Loading…
Add table
Reference in a new issue