Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is there any way to re-queue videos in bulk?
I often need to re-queue existing videos in my development server.
A "Re-queue selected content" option in Update Options at admin/content would be really helpful.
Only thing I could find relevant to this topic is #1517998: Mass video node creation and transcoding
Then, I was looking into possible hook_action_info() implementation for the Video module.
Seems like something like below is needed. But I am not really sure what it really involves to make it happen.
Any ideas, or suggestions?
/**
* Implements hook_action_info().
*/
function video_action_info() {
return array(
'video_re_convert_video' => array(
'type' => 'node',
'label' => t('Re-queue selected content'),
'configurable' => FALSE,
'behavior' => array('changes_property'),
'triggers' => array('node_presave'),
),
);
}
function video_re_convert_video($node, $context = array()) {
$factory = new TranscoderAbstractionAbstractFactory();
$transcoder = $factory->getProduct();
$video->video_status = VIDEO_RENDERING_INQUEUE;
$transcoder->updateJob($video);
watchdog('action', 'Re-queue @type %title to be transcoded.', array('@type' => node_type_get_name($node), '%title' => $node->title));
}
Comment | File | Size | Author |
---|
Comments
Comment #1
Jorrit CreditAttribution: Jorrit commentedThis is a very good suggestion. In next release (7.x-2.9) I intend to improve rules and token support and I suppose that this feature can be implemented then as well.
Comment #2
michael.k CreditAttribution: michael.k commentedIf you were to add support for the Views Bulk Operations module, many types of changes could be made in bulk.
Every user has a different mashup of course, but VBO is indispensable in my workflow.
Comment #3
Jorrit CreditAttribution: Jorrit commentedThat was what I was also thinking about. For all that kind of stuff: wait for 2.9.
Comment #4
michael.k CreditAttribution: michael.k commentedSweet!
Comment #5
theamoeba CreditAttribution: theamoeba commentedI have been working on some code that uses the hook_node_operations hook.
Comment #6
selfsimilar CreditAttribution: selfsimilar commentedPost #5 was a great help. The only issue I had was I needed to change the foreach loop to:
Comment #7
MilosL CreditAttribution: MilosL commentedAbove code "adapted" for using as "Execute arbitrary PHP Script" in advanced actions - works with VBO (Views Bulk Operations).
Comment #8
heshanlkComment #9
chaitanya17 CreditAttribution: chaitanya17 at Cybage Software Pvt Ltd. for Cybage Software Pvt Ltd. commentedHi osman,
In
admin/content
, we can't haveRe-queue selected content
option as not all content types will have video field.Instead we can create separate content type view page that is having video field. And custom bulk operation through rules. In rules we need to define custom code need to be executed, and use @MilosL code.
With status message,
Comment #10
heshanlk