Skip to content

media groups are not removed/updated when media are deleted

Description

When deleting a media, the Media is removed from the db, but the MediaGroup is not updated/removed.

If it was the only item in the group and the group by name is enabled, the UI will crash in VideoGroupsProvider.extractSingles() because medialib says it mediaCount=1 and return an empty array.

Medias from a group can also be added again in the same group, increasing the media count, even without any new media added which match the group. Don't know when it happens exactly, maybe when re-scanning in some conditions.

Steps to reproduce

  1. Delete a video from vlc
  2. MediaGroup is not updated / removed, and UI can crash

Context

App version

3.3.0-dev, revision vlc-android@5cd908b7, medialibrary 079fbeac

Android version / Device model

Android 7 on Shield Tablet K1

Android 9 on Sony Xperia XZ2

App mode : Smartphone

vlc_media.db

Edited by Sébastien Toque
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information