mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-08-21 09:49:29 +00:00
Merge branch 'master' of gitlab.futo.org:videostreaming/grayjay
This commit is contained in:
commit
670df86114
8 changed files with 86 additions and 62 deletions
6
.gitmodules
vendored
6
.gitmodules
vendored
|
@ -100,3 +100,9 @@
|
|||
[submodule "app/src/unstable/assets/sources/curiositystream"]
|
||||
path = app/src/unstable/assets/sources/curiositystream
|
||||
url = ../plugins/curiositystream.git
|
||||
[submodule "app/src/unstable/assets/sources/crunchyroll"]
|
||||
path = app/src/unstable/assets/sources/crunchyroll
|
||||
url = ../plugins/crunchyroll.git
|
||||
[submodule "app/src/stable/assets/sources/crunchyroll"]
|
||||
path = app/src/stable/assets/sources/crunchyroll
|
||||
url = ../plugins/crunchyroll.git
|
||||
|
|
|
@ -71,7 +71,8 @@ class ChannelContentsFragment(private val subType: String? = null) : Fragment(),
|
|||
val lastPolycentricProfile = _lastPolycentricProfile;
|
||||
var pager: IPager<IPlatformContent>? = null;
|
||||
if (lastPolycentricProfile != null && StatePolycentric.instance.enabled)
|
||||
pager = StatePolycentric.instance.getChannelContent(lifecycleScope, lastPolycentricProfile);
|
||||
pager =
|
||||
StatePolycentric.instance.getChannelContent(lifecycleScope, lastPolycentricProfile, type = subType);
|
||||
|
||||
if(pager == null) {
|
||||
if(subType != null)
|
||||
|
|
|
@ -732,7 +732,7 @@ class StatePlatform {
|
|||
}
|
||||
}
|
||||
|
||||
fun getChannelContent(baseClient: IPlatformClient, channelUrl: String, isSubscriptionOptimized: Boolean = false, usePooledClients: Int = 0): IPager<IPlatformContent> {
|
||||
fun getChannelContent(baseClient: IPlatformClient, channelUrl: String, isSubscriptionOptimized: Boolean = false, usePooledClients: Int = 0, type: String? = null): IPager<IPlatformContent> {
|
||||
val clientCapabilities = baseClient.getChannelCapabilities();
|
||||
val client = if(usePooledClients > 1)
|
||||
_channelClientPool.getClientPooled(baseClient, usePooledClients);
|
||||
|
@ -741,6 +741,7 @@ class StatePlatform {
|
|||
var lastStream: OffsetDateTime? = null;
|
||||
|
||||
val pagerResult: IPager<IPlatformContent>;
|
||||
if (type == null) {
|
||||
if(!clientCapabilities.hasType(ResultCapabilities.TYPE_MIXED) &&
|
||||
( clientCapabilities.hasType(ResultCapabilities.TYPE_VIDEOS) ||
|
||||
clientCapabilities.hasType(ResultCapabilities.TYPE_STREAMS) ||
|
||||
|
@ -799,8 +800,16 @@ class StatePlatform {
|
|||
pager.initialize();
|
||||
pagerResult = pager;
|
||||
}
|
||||
else
|
||||
else {
|
||||
pagerResult = client.getChannelContents(channelUrl, ResultCapabilities.TYPE_MIXED, ResultCapabilities.ORDER_CHONOLOGICAL);
|
||||
}
|
||||
} else {
|
||||
pagerResult = if (type == ResultCapabilities.TYPE_SHORTS && clientCapabilities.hasType(ResultCapabilities.TYPE_SHORTS)) {
|
||||
client.getChannelContents(channelUrl, ResultCapabilities.TYPE_SHORTS, ResultCapabilities.ORDER_CHONOLOGICAL);
|
||||
} else {
|
||||
EmptyPager()
|
||||
}
|
||||
}
|
||||
|
||||
//Subscription optimization
|
||||
val sub = StateSubscriptions.instance.getSubscription(channelUrl);
|
||||
|
@ -852,10 +861,10 @@ class StatePlatform {
|
|||
|
||||
return pagerResult;
|
||||
}
|
||||
fun getChannelContent(channelUrl: String, isSubscriptionOptimized: Boolean = false, usePooledClients: Int = 0, ignorePlugins: List<String>? = null): IPager<IPlatformContent> {
|
||||
fun getChannelContent(channelUrl: String, isSubscriptionOptimized: Boolean = false, usePooledClients: Int = 0, ignorePlugins: List<String>? = null, type: String? = null): IPager<IPlatformContent> {
|
||||
Logger.i(TAG, "Platform - getChannelVideos");
|
||||
val baseClient = getChannelClient(channelUrl, ignorePlugins);
|
||||
return getChannelContent(baseClient, channelUrl, isSubscriptionOptimized, usePooledClients);
|
||||
return getChannelContent(baseClient, channelUrl, isSubscriptionOptimized, usePooledClients, type);
|
||||
}
|
||||
fun getChannelContent(channelUrl: String, type: String?, ordering: String = ResultCapabilities.ORDER_CHONOLOGICAL): IPager<IPlatformContent> {
|
||||
val client = getChannelClient(channelUrl);
|
||||
|
|
|
@ -236,7 +236,7 @@ class StatePolycentric {
|
|||
return Pair(didUpdate, listOf(url));
|
||||
}
|
||||
|
||||
fun getChannelContent(scope: CoroutineScope, profile: PolycentricProfile, isSubscriptionOptimized: Boolean = false, channelConcurrency: Int = -1): IPager<IPlatformContent>? {
|
||||
fun getChannelContent(scope: CoroutineScope, profile: PolycentricProfile, isSubscriptionOptimized: Boolean = false, channelConcurrency: Int = -1, type: String? = null): IPager<IPlatformContent>? {
|
||||
ensureEnabled()
|
||||
|
||||
//TODO: Currently abusing subscription concurrency for parallelism
|
||||
|
@ -248,7 +248,11 @@ class StatePolycentric {
|
|||
|
||||
return@mapNotNull Pair(client, scope.async(Dispatchers.IO) {
|
||||
try {
|
||||
if (type == null) {
|
||||
return@async StatePlatform.instance.getChannelContent(url, isSubscriptionOptimized, concurrency);
|
||||
} else {
|
||||
return@async StatePlatform.instance.getChannelContent(url, isSubscriptionOptimized, concurrency, type = type);
|
||||
}
|
||||
} catch (ex: Throwable) {
|
||||
Logger.e(TAG, "getChannelContent", ex);
|
||||
return@async null;
|
||||
|
|
1
app/src/stable/assets/sources/crunchyroll
Submodule
1
app/src/stable/assets/sources/crunchyroll
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 1aa91f216c0a87604aed1669b63b7830e4288630
|
|
@ -15,7 +15,8 @@
|
|||
"e8b1ad5f-0c6d-497d-a5fa-0a785a16d902": "sources/bitchute/BitchuteConfig.json",
|
||||
"89ae4889-0420-4d16-ad6c-19c776b28f99": "sources/apple-podcasts/ApplePodcastsConfig.json",
|
||||
"8d029a7f-5507-4e36-8bd8-c19a3b77d383": "sources/tedtalks/TedTalksConfig.json",
|
||||
"273b6523-5438-44e2-9f5d-78e0325a8fd9": "sources/curiositystream/CuriosityStreamConfig.json"
|
||||
"273b6523-5438-44e2-9f5d-78e0325a8fd9": "sources/curiositystream/CuriosityStreamConfig.json",
|
||||
"9bb33039-8580-48d4-9849-21319ae845a4": "sources/crunchyroll/CrunchyrollConfig.json"
|
||||
},
|
||||
"SOURCES_EMBEDDED_DEFAULT": [
|
||||
"35ae969a-a7db-11ed-afa1-0242ac120002"
|
||||
|
|
1
app/src/unstable/assets/sources/crunchyroll
Submodule
1
app/src/unstable/assets/sources/crunchyroll
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 1aa91f216c0a87604aed1669b63b7830e4288630
|
|
@ -15,7 +15,8 @@
|
|||
"e8b1ad5f-0c6d-497d-a5fa-0a785a16d902": "sources/bitchute/BitchuteConfig.json",
|
||||
"89ae4889-0420-4d16-ad6c-19c776b28f99": "sources/apple-podcasts/ApplePodcastsConfig.json",
|
||||
"8d029a7f-5507-4e36-8bd8-c19a3b77d383": "sources/tedtalks/TedTalksConfig.json",
|
||||
"273b6523-5438-44e2-9f5d-78e0325a8fd9": "sources/curiositystream/CuriosityStreamConfig.json"
|
||||
"273b6523-5438-44e2-9f5d-78e0325a8fd9": "sources/curiositystream/CuriosityStreamConfig.json",
|
||||
"9bb33039-8580-48d4-9849-21319ae845a4": "sources/crunchyroll/CrunchyrollConfig.json"
|
||||
},
|
||||
"SOURCES_EMBEDDED_DEFAULT": [
|
||||
"35ae969a-a7db-11ed-afa1-0242ac120002"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue