File tree Expand file tree Collapse file tree
app/src/main/java/com/github/libretube Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,10 +8,8 @@ import androidx.core.net.toUri
88import com.github.libretube.R
99import com.github.libretube.api.JsonHelper
1010import com.github.libretube.api.PlaylistsHelper
11- import com.github.libretube.api.RetrofitInstance
1211import com.github.libretube.api.SubscriptionHelper
1312import com.github.libretube.db.DatabaseHelper
14- import com.github.libretube.db.DatabaseHolder.Database
1513import com.github.libretube.db.obj.WatchHistoryItem
1614import com.github.libretube.enums.ImportFormat
1715import com.github.libretube.extensions.TAG
@@ -108,12 +106,7 @@ object ImportHelper {
108106 @OptIn(ExperimentalSerializationApi ::class )
109107 suspend fun exportSubscriptions (activity : Activity , uri : Uri , importFormat : ImportFormat ) {
110108 val token = PreferenceHelper .getToken()
111- val subs = if (token.isNotEmpty()) {
112- RetrofitInstance .authApi.subscriptions(token)
113- } else {
114- val subscriptions = Database .localSubscriptionDao().getAll().map { it.channelId }
115- RetrofitInstance .authApi.unauthenticatedSubscriptions(subscriptions)
116- }
109+ val subs = SubscriptionHelper .getSubscriptions()
117110
118111 when (importFormat) {
119112 ImportFormat .NEWPIPE -> {
Original file line number Diff line number Diff line change @@ -382,11 +382,7 @@ class PlaylistFragment : DynamicLayoutManagerFragment(R.layout.fragment_playlist
382382 val response = try {
383383 withContext(Dispatchers .IO ) {
384384 // load locally stored playlists with the auth api
385- if (playlistType == PlaylistType .PRIVATE ) {
386- RetrofitInstance .authApi.getPlaylistNextPage(playlistId, nextPage!! )
387- } else {
388- RetrofitInstance .api.getPlaylistNextPage(playlistId, nextPage!! )
389- }
385+ RetrofitInstance .api.getPlaylistNextPage(playlistId, nextPage!! )
390386 }
391387 } catch (e: Exception ) {
392388 context?.toastFromMainDispatcher(e.localizedMessage.orEmpty())
Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ object PlayingQueue {
158158 ) {
159159 var playlistNextPage = nextPage
160160 while (playlistNextPage != null ) {
161- RetrofitInstance .authApi .getPlaylistNextPage(playlistId, playlistNextPage).run {
161+ RetrofitInstance .api .getPlaylistNextPage(playlistId, playlistNextPage).run {
162162 addToQueueAsync(relatedStreams, isMainList = isMainList)
163163 playlistNextPage = this .nextpage
164164 }
You can’t perform that action at this time.
0 commit comments