setOverrideThumbnailFromMediaItem method
Given a MediaItem, set its override display thumbnail. If null, this deletes the override thumbnail.
Implementation
Future<void> setOverrideThumbnailFromMediaItem({
required AppModel appModel,
required MediaItem item,
required File? file,
required bool clearOverrideImage,
}) async {
String filename = getOverrideThumbnailFilename(
appModel: appModel,
item: item,
);
File thumbnailFile = File(filename);
thumbnailFile.createSync(recursive: true);
if (clearOverrideImage) {
thumbnailFile.deleteSync();
} else if (file != null) {
file.copySync(filename);
}
}