Skip to content

Commit

Permalink
Fix directly opening playlists urls in wrong ui, causing wrong thread
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelvin-FUTO committed Dec 2, 2024
1 parent e2e5e36 commit 6f00483
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ class MainActivity : AppCompatActivity, IWithResultLauncher {
} else if (StatePlatform.instance.hasEnabledPlaylistClient(url)) {
Logger.i(TAG, "handleUrl(url=$url) found playlist client");
lifecycleScope.launch(Dispatchers.Main) {
navigate(_fragMainPlaylist, url);
navigate(_fragMainRemotePlaylist, url);
delay(100);
_fragVideoDetail.minimizeVideoDetail();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class PlaylistFragment : MainFragment() {
private var _editPlaylistOverlay: SlideUpMenuOverlay? = null;
private var _url: String? = null;

private val _taskLoadPlaylist: TaskHandler<String, IPlatformPlaylistDetails>;
private val _taskLoadPlaylist: TaskHandler<String, Playlist>;

constructor(fragment: PlaylistFragment, inflater: LayoutInflater) : super(inflater) {
_fragment = fragment;
Expand Down Expand Up @@ -137,16 +137,16 @@ class PlaylistFragment : MainFragment() {
);
};

_taskLoadPlaylist = TaskHandler<String, IPlatformPlaylistDetails>(
_taskLoadPlaylist = TaskHandler<String, Playlist>(
StateApp.instance.scopeGetter,
{
return@TaskHandler StatePlatform.instance.getPlaylist(it);
return@TaskHandler StatePlatform.instance.getPlaylist(it).toPlaylist();
})
.success {
setName(it.name);
//TODO: Implement support for pagination
setVideos(it.toPlaylist().videos, false);
setVideoCount(it.videoCount);
setVideos(it.videos, false);
setVideoCount(it.videos.size);
setLoading(false);
}
.exception<Throwable> {
Expand Down

0 comments on commit 6f00483

Please sign in to comment.