File tree Expand file tree Collapse file tree
android/src/main/kotlin/project/pipepipe/app/service
library/src/commonMain/kotlin/project/pipepipe/app/ui/screens/settings Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,10 +119,39 @@ class FeedWorker(
119119
120120 DatabaseOperations .insertOrUpdateSubscription(result.info!! as ChannelInfo , true )
121121
122+ var streamInfoList = mutableListOf<StreamInfo >()
123+
122124 if (result.pagedData != null ) {
125+ streamInfoList.addAll(result.pagedData!! .itemList as List <StreamInfo >)
126+ }
127+
128+ val channelInfo = result.info as ChannelInfo
129+ val fetchChannelTabs = SharedContext .settingsManager.getStringSet(" feed_fetch_channel_tabs_key" , setOf (" fetch_channel_tabs_videos" ))
130+ if (! fetchChannelTabs.contains(" fetch_channel_tabs_videos" )) {
131+ streamInfoList.clear()
132+ }
133+ val fetchLiveTabs = fetchChannelTabs.contains(" fetch_channel_tabs_live" )
134+
135+ if (fetchLiveTabs) {
136+ val liveTab = channelInfo.tabs.find { it.type.name == " LIVE" }
137+ if (liveTab != null ) {
138+ val liveResult = withContext(Dispatchers .IO ) {
139+ executeJobFlow(
140+ SupportedJobType .FETCH_FIRST_PAGE ,
141+ liveTab.url,
142+ subscription.service_id
143+ )
144+ }
145+ if (liveResult.pagedData != null ) {
146+ streamInfoList.addAll(liveResult.pagedData!! .itemList as List <StreamInfo >)
147+ }
148+ }
149+ }
150+
151+ if (streamInfoList.isNotEmpty()) {
123152 DatabaseOperations .updateSubscriptionFeed(
124153 subscription.url!! ,
125- result.pagedData !! .itemList as List < StreamInfo >
154+ streamInfoList
126155 )
127156 } else {
128157 failedCount.incrementAndGet()
Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ fun FeedSettingsScreen(
177177 summary = stringResource(MR .strings.feed_fetch_channel_tabs_summary),
178178 entries = feedFetchChannelTabsEntries,
179179 entryValues = feedFetchChannelTabsValues,
180- defaultValues = feedFetchChannelTabsValues.toSet( ),
180+ defaultValues = setOf ( " fetch_channel_tabs_videos " ),
181181 onValuesChange = { values ->
182182 feedFetchChannelTabsValue = values
183183 }
You can’t perform that action at this time.
0 commit comments