mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-19 19:14:51 +00:00
changed playlist limit to 100
added save button to non-saved local playlists
This commit is contained in:
parent
696e03941a
commit
b7781264d3
2 changed files with 41 additions and 34 deletions
|
@ -14,6 +14,7 @@ import com.futo.platformplayer.api.media.models.video.IPlatformVideo
|
|||
import com.futo.platformplayer.api.media.models.video.SerializedPlatformVideo
|
||||
import com.futo.platformplayer.constructs.TaskHandler
|
||||
import com.futo.platformplayer.downloads.VideoDownload
|
||||
import com.futo.platformplayer.fragment.mainactivity.topbar.NavigationTopBarFragment
|
||||
import com.futo.platformplayer.logging.Logger
|
||||
import com.futo.platformplayer.models.Playlist
|
||||
import com.futo.platformplayer.states.StateApp
|
||||
|
@ -144,53 +145,59 @@ class PlaylistFragment : MainFragment() {
|
|||
}
|
||||
|
||||
fun onShown(parameter: Any?) {
|
||||
_taskLoadPlaylist.cancel();
|
||||
_taskLoadPlaylist.cancel()
|
||||
|
||||
if (parameter is Playlist?) {
|
||||
_playlist = parameter;
|
||||
_url = null;
|
||||
_playlist = parameter
|
||||
_url = null
|
||||
|
||||
if(parameter != null) {
|
||||
setName(parameter.name);
|
||||
setVideos(parameter.videos, true);
|
||||
setVideoCount(parameter.videos.size);
|
||||
setButtonDownloadVisible(true);
|
||||
setButtonEditVisible(true);
|
||||
if (parameter != null) {
|
||||
setName(parameter.name)
|
||||
setVideos(parameter.videos, true)
|
||||
setVideoCount(parameter.videos.size)
|
||||
setButtonDownloadVisible(true)
|
||||
setButtonEditVisible(true)
|
||||
|
||||
if (!StatePlaylists.instance.playlistStore.getItems().contains(parameter)) {
|
||||
_fragment.topBar?.assume<NavigationTopBarFragment>()
|
||||
?.setMenuItems(arrayListOf(Pair(R.drawable.ic_copy) {
|
||||
StatePlaylists.instance.playlistStore.save(parameter)
|
||||
UIDialogs.toast("Playlist saved")
|
||||
}))
|
||||
}
|
||||
} else {
|
||||
setName(null);
|
||||
setVideos(null, false);
|
||||
setVideoCount(-1);
|
||||
setButtonDownloadVisible(false);
|
||||
setButtonEditVisible(false);
|
||||
setName(null)
|
||||
setVideos(null, false)
|
||||
setVideoCount(-1)
|
||||
setButtonDownloadVisible(false)
|
||||
setButtonEditVisible(false)
|
||||
}
|
||||
|
||||
//TODO: Do I have to remove the showConvertPlaylistButton(); button here?
|
||||
} else if (parameter is IPlatformPlaylist) {
|
||||
_playlist = null;
|
||||
_url = parameter.url;
|
||||
_playlist = null
|
||||
_url = parameter.url
|
||||
|
||||
setVideoCount(parameter.videoCount);
|
||||
setName(parameter.name);
|
||||
setVideos(null, false);
|
||||
setButtonDownloadVisible(false);
|
||||
setButtonEditVisible(false);
|
||||
setVideoCount(parameter.videoCount)
|
||||
setName(parameter.name)
|
||||
setVideos(null, false)
|
||||
setButtonDownloadVisible(false)
|
||||
setButtonEditVisible(false)
|
||||
|
||||
fetchPlaylist();
|
||||
fetchPlaylist()
|
||||
} else if (parameter is String) {
|
||||
_playlist = null;
|
||||
_url = parameter;
|
||||
_playlist = null
|
||||
_url = parameter
|
||||
|
||||
setName(null);
|
||||
setVideos(null, false);
|
||||
setVideoCount(-1);
|
||||
setButtonDownloadVisible(false);
|
||||
setButtonEditVisible(false);
|
||||
setName(null)
|
||||
setVideos(null, false)
|
||||
setVideoCount(-1)
|
||||
setButtonDownloadVisible(false)
|
||||
setButtonEditVisible(false)
|
||||
|
||||
fetchPlaylist();
|
||||
fetchPlaylist()
|
||||
}
|
||||
|
||||
_playlist?.let {
|
||||
updateDownloadState(VideoDownload.GROUP_PLAYLIST, it.id, this::download);
|
||||
updateDownloadState(VideoDownload.GROUP_PLAYLIST, it.id, this::download)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -323,7 +323,7 @@ class RemotePlaylistFragment : MainFragment() {
|
|||
}
|
||||
}
|
||||
|
||||
if (remotePlaylist.videoCount > 20) {
|
||||
if (remotePlaylist.videoCount > 100) {
|
||||
val c = context ?: return
|
||||
UIDialogs.showConfirmationDialog(
|
||||
c, "Conversion to local playlist is required for this action", convert
|
||||
|
|
Loading…
Add table
Reference in a new issue