Playlist creation parsing before files exists

In VLC-iOS, importing files through 'Wi-Fi' could lead to empty playlists being created if the playlist file is imported and parsed before the files.

For example, if the user imports:

  ├── folder
      ├── track01.mp3
      ├── playlist.m3u8
      └── sub-folder
          └── track02.mp3

If playlists.m3u8 is uploaded before the tracks, an empty playlists will be created since we ask for a media library reload on a new file discovery.

Indeed, the medialibrary will report in the logs that the files doesn't exist on the disk.

After discussing with @chouquette, we thought that we could either:

  • Reload/reparse the playlists dynamically, but the issue might be that we cannot know which media are directly associated to a specific medialibrary playlist?

  • On the app side, reload the medialibrary strategically, (e.g. once when all files for a batch of import is complete) but that would affect the dynamic refreshing of the user interface.