mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-19 19:14:51 +00:00
Resume on playback error instead of reseting, dont error on empty author url, subs exchange fixes
This commit is contained in:
parent
b652597924
commit
7f7ebafa46
2 changed files with 9 additions and 7 deletions
|
@ -1907,7 +1907,7 @@ class VideoDetailView : ConstraintLayout {
|
|||
else null;
|
||||
withContext(Dispatchers.Main) {
|
||||
video = newDetails;
|
||||
_player.setSource(newVideoSource, newAudioSource, true, true);
|
||||
_player.setSource(newVideoSource, newAudioSource, true, true, true);
|
||||
}
|
||||
}
|
||||
} catch (e: Throwable) {
|
||||
|
@ -2645,7 +2645,10 @@ class VideoDetailView : ConstraintLayout {
|
|||
}
|
||||
|
||||
onChannelClicked.subscribe {
|
||||
fragment.navigate<ChannelFragment>(it)
|
||||
if(it.url.isNotBlank())
|
||||
fragment.navigate<ChannelFragment>(it)
|
||||
else
|
||||
UIDialogs.appToast("No author url present");
|
||||
}
|
||||
|
||||
onAddToWatchLaterClicked.subscribe(this) {
|
||||
|
|
|
@ -15,7 +15,6 @@ import com.futo.platformplayer.api.media.structures.PlatformContentPager
|
|||
import com.futo.platformplayer.engine.exceptions.PluginException
|
||||
import com.futo.platformplayer.engine.exceptions.ScriptCaptchaRequiredException
|
||||
import com.futo.platformplayer.engine.exceptions.ScriptCriticalException
|
||||
import com.futo.platformplayer.engine.exceptions.ScriptException
|
||||
import com.futo.platformplayer.exceptions.ChannelException
|
||||
import com.futo.platformplayer.findNonRuntimeException
|
||||
import com.futo.platformplayer.fragment.mainactivity.main.SubscriptionsFeedFragment
|
||||
|
@ -77,10 +76,10 @@ abstract class SubscriptionsTaskFetchAlgorithm(
|
|||
|
||||
|
||||
|
||||
val liveTasks = tasks.filter { !it.fromPeek && !it.fromCache };
|
||||
val contract = subsExchangeClient?.requestContract(*liveTasks.map { ChannelRequest(it.url) }.toTypedArray());
|
||||
val contractableTasks = tasks.filter { !it.fromPeek && !it.fromCache && (it.type == ResultCapabilities.TYPE_VIDEOS || it.type == ResultCapabilities.TYPE_MIXED) };
|
||||
val contract = if(contractableTasks.size > 10) subsExchangeClient?.requestContract(*contractableTasks.map { ChannelRequest(it.url) }.toTypedArray()) else null;
|
||||
var providedTasks: MutableList<SubscriptionTask>? = null;
|
||||
if(contract != null && contract.provided.size > 0){
|
||||
if(contract != null && contract.provided.isNotEmpty()){
|
||||
providedTasks = mutableListOf()
|
||||
for(task in tasks.toList()){
|
||||
if(!task.fromCache && !task.fromPeek && contract.provided.contains(task.url)) {
|
||||
|
@ -130,7 +129,7 @@ abstract class SubscriptionsTaskFetchAlgorithm(
|
|||
try {
|
||||
val resolve = subsExchangeClient?.resolveContract(
|
||||
contract,
|
||||
*taskResults.filter { it.pager != null }.map {
|
||||
*taskResults.filter { it.pager != null && (it.task.type == ResultCapabilities.TYPE_MIXED || it.task.type == ResultCapabilities.TYPE_VIDEOS) }.map {
|
||||
ChannelResolve(
|
||||
it.task.url,
|
||||
it.pager!!.getResults()
|
||||
|
|
Loading…
Add table
Reference in a new issue