[Android] Fix video group title not displayed after grouping

Nicolas Pomepuy git at videolan.org
Thu Nov 12 18:23:08 CET 2020


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Nov 12 13:49:16 2020 +0100| [646476e492e57f62e1c9ef829e7b3242c27f94f9] | committer: Nicolas Pomepuy

Fix video group title not displayed after grouping

> https://code.videolan.org/videolan/vlc-android/commit/646476e492e57f62e1c9ef829e7b3242c27f94f9
---

 .../vlc-android/src/org/videolan/vlc/gui/dialogs/AddToGroupDialog.kt     | 1 -
 .../src/org/videolan/vlc/viewmodels/mobile/VideosViewModel.kt            | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/AddToGroupDialog.kt b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/AddToGroupDialog.kt
index bfe4559dc..2fa35e1a7 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/AddToGroupDialog.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/AddToGroupDialog.kt
@@ -90,7 +90,6 @@ class AddToGroupDialog : VLCBottomSheetDialogFragment(), SimpleAdapter.ClickHand
         }
 
         forbidNewGroup = try {
-            @Suppress("UNCHECKED_CAST")
             requireArguments().getBoolean(FORBID_NEW_GROUP)
         } catch (e: Exception) {
             true
diff --git a/application/vlc-android/src/org/videolan/vlc/viewmodels/mobile/VideosViewModel.kt b/application/vlc-android/src/org/videolan/vlc/viewmodels/mobile/VideosViewModel.kt
index dacf9a793..e8bb570fa 100644
--- a/application/vlc-android/src/org/videolan/vlc/viewmodels/mobile/VideosViewModel.kt
+++ b/application/vlc-android/src/org/videolan/vlc/viewmodels/mobile/VideosViewModel.kt
@@ -197,6 +197,7 @@ class VideosViewModel(context: Context, type: VideoGroupingType, val folder: Fol
             val newGroup = medialibrary.createVideoGroup(medias.map { it.id }.toLongArray())
             if (newGroup.title.isNullOrBlank()) {
                 newGroup.rename(medias[0].title)
+                newGroup.title = medias[0].title
             }
             newGroup
         }



More information about the Android mailing list