more_fields-2.2.19/modules/video/more_fields_video.module
modules/video/more_fields_video.module
<?php
use Drupal\file\Entity\File;
use FFMpeg\FFMpeg;
use FFMpeg\Coordinate\TimeCode;
use Drupal\Core\File\FileSystem;
use Drupal\more_fields_video\Entity\MultiformatVideo;
/**
* Implements hook_file_delete().
*/
function more_fields_video_file_delete($file) {
dump($file->id());
$multiformat = MultiformatVideo::load($file->id);
if (isset($multiformat)) {
$thumb_id = $multiformat->getThumbId();
if (isset($thumb_id)) {
$thumb_file = File::load($thumb_id);
if (isset($thumb_file)) {
$thumb_file->delete();
}
}
$multiformat->delete();
}
}
