mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-05-01 15:14:29 +02:00
Fix directly opening playlists urls in wrong ui, causing wrong thread
This commit is contained in:
parent
e2e5e36bad
commit
6f004830ff
@ -834,7 +834,7 @@ class MainActivity : AppCompatActivity, IWithResultLauncher {
|
|||||||
} else if (StatePlatform.instance.hasEnabledPlaylistClient(url)) {
|
} else if (StatePlatform.instance.hasEnabledPlaylistClient(url)) {
|
||||||
Logger.i(TAG, "handleUrl(url=$url) found playlist client");
|
Logger.i(TAG, "handleUrl(url=$url) found playlist client");
|
||||||
lifecycleScope.launch(Dispatchers.Main) {
|
lifecycleScope.launch(Dispatchers.Main) {
|
||||||
navigate(_fragMainPlaylist, url);
|
navigate(_fragMainRemotePlaylist, url);
|
||||||
delay(100);
|
delay(100);
|
||||||
_fragVideoDetail.minimizeVideoDetail();
|
_fragVideoDetail.minimizeVideoDetail();
|
||||||
};
|
};
|
||||||
|
@ -70,7 +70,7 @@ class PlaylistFragment : MainFragment() {
|
|||||||
private var _editPlaylistOverlay: SlideUpMenuOverlay? = null;
|
private var _editPlaylistOverlay: SlideUpMenuOverlay? = null;
|
||||||
private var _url: String? = 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) {
|
constructor(fragment: PlaylistFragment, inflater: LayoutInflater) : super(inflater) {
|
||||||
_fragment = fragment;
|
_fragment = fragment;
|
||||||
@ -137,16 +137,16 @@ class PlaylistFragment : MainFragment() {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
_taskLoadPlaylist = TaskHandler<String, IPlatformPlaylistDetails>(
|
_taskLoadPlaylist = TaskHandler<String, Playlist>(
|
||||||
StateApp.instance.scopeGetter,
|
StateApp.instance.scopeGetter,
|
||||||
{
|
{
|
||||||
return@TaskHandler StatePlatform.instance.getPlaylist(it);
|
return@TaskHandler StatePlatform.instance.getPlaylist(it).toPlaylist();
|
||||||
})
|
})
|
||||||
.success {
|
.success {
|
||||||
setName(it.name);
|
setName(it.name);
|
||||||
//TODO: Implement support for pagination
|
//TODO: Implement support for pagination
|
||||||
setVideos(it.toPlaylist().videos, false);
|
setVideos(it.videos, false);
|
||||||
setVideoCount(it.videoCount);
|
setVideoCount(it.videos.size);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
.exception<Throwable> {
|
.exception<Throwable> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user