deleteMediaItem method

Future<void> deleteMediaItem(
  1. MediaItem item
)

Deletes a MediaItem from history and also rids of override values.

Implementation

Future<void> deleteMediaItem(MediaItem item) async {
  MediaSource mediaSource = item.getMediaSource(appModel: this);
  await mediaSource.clearOverrideValues(appModel: this, item: item);
  await mediaSource.onMediaItemClear(item);

  _database.writeTxnSync(() {
    _database.mediaItems.deleteSync(item.id!);
  });
}