mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-01-06 01:20:29 +05:30
improve
This commit is contained in:
parent
03686dd4ff
commit
fc603ea540
@ -22,6 +22,7 @@ class PlaylistFragment : Fragment() {
|
|||||||
private lateinit var binding: FragmentPlaylistBinding
|
private lateinit var binding: FragmentPlaylistBinding
|
||||||
|
|
||||||
private var playlistId: String? = null
|
private var playlistId: String? = null
|
||||||
|
private var isOwner: Boolean = false
|
||||||
var nextPage: String? = null
|
var nextPage: String? = null
|
||||||
private var playlistAdapter: PlaylistAdapter? = null
|
private var playlistAdapter: PlaylistAdapter? = null
|
||||||
private var isLoading = true
|
private var isLoading = true
|
||||||
@ -78,7 +79,7 @@ class PlaylistFragment : Fragment() {
|
|||||||
|
|
||||||
val user = PreferenceHelper.getUsername()
|
val user = PreferenceHelper.getUsername()
|
||||||
// check whether the user owns the playlist
|
// check whether the user owns the playlist
|
||||||
val isOwner = response.uploaderUrl == null &&
|
isOwner = response.uploaderUrl == null &&
|
||||||
response.uploader.equals(user, true)
|
response.uploader.equals(user, true)
|
||||||
|
|
||||||
// show playlist options
|
// show playlist options
|
||||||
@ -141,7 +142,7 @@ class PlaylistFragment : Fragment() {
|
|||||||
|
|
||||||
private fun isPipedPlaylist(): Boolean {
|
private fun isPipedPlaylist(): Boolean {
|
||||||
val regex = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
|
val regex = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
|
||||||
return playlistId?.contains(regex) == true
|
return playlistId?.contains(regex) == true || isOwner
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun Fragment?.runOnUiThread(action: () -> Unit) {
|
private fun Fragment?.runOnUiThread(action: () -> Unit) {
|
||||||
|
Loading…
Reference in New Issue
Block a user