Closed (fixed)
Project:
Media Mover Custom Command
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
12 Feb 2009 at 19:37 UTC
Updated:
26 Feb 2009 at 21:20 UTC
Helo
I found media mover very useful but i run into serous issue for me:
I want the media_mover to harvest a file from local dir, process it via custom command and store the harvested file in given dir. Command is creating a torrent file out of given file. That is my config:
$configuration = new stdClass;
$configuration->required = array('mm_dir', 'mm_custom_command', 'media_mover_ftp', 'mm_dir');
$configuration->name = 'make seed';
$configuration->cid = '5';
$configuration->description = 'make seed and send via ftp';
$configuration->start_time = '1234465747';
$configuration->last_start_time = '1234465688';
$configuration->status = 'stopped';
$configuration->settings->mma_file_perm = '0';
$configuration->settings->mma_file_mask = '0644';
$configuration->settings->mma_node_edit_item_show = '0';
$configuration->settings->mma_node_item_delete = '1';
$configuration->settings->mma_node_config_rss = '0';
$configuration->settings->mma_cron_notify = '0';
$configuration->settings->mma_cron_notify_email = '';
$configuration->settings->mma_cron_notify_time = '10';
$configuration->settings->mma_process_num = '0';
$configuration->settings->mma_storage_num = '0';
$configuration->settings->mma_complete_num = '0';
$configuration->harvest->module = 'mm_dir';
$configuration->harvest->action = '1';
$configuration->harvest->configuration = array(
'path' => '/var/www/drupal/sites/default/files/torrent-noruszaj',
'file_types' => 'avi mov wmv mpeg mp4 mpeg2 dv 3gp 3g2 mpeg4',
'cid' => '5',
'module' => 'mm_dir',
'action' => '1',
'verb' => 'harvest'
);
$configuration->harvest->cid = '5';
$configuration->process->module = 'mm_custom_command';
$configuration->process->action = '1';
$configuration->process->configuration = array(
'output_file' => '',
'command' => 'sh /var/www/torrent/bin/make-copy.sh [harvest_file]',
'cid' => '5',
'module' => 'mm_custom_command',
'action' => '1',
'verb' => 'process'
);
$configuration->process->cid = '5';
$configuration->storage->module = 'media_mover_ftp';
$configuration->storage->action = '2';
$configuration->storage->configuration = array(
'mm_ftp_user' => 'noruszaj',
'mm_ftp_pass' => 'muchomjeje',
'mm_ftp_host' => 'noruszaj.tutturu.bzzz.net',
'mm_ftp_dir' => '.',
'mm_ftp_url' => '<none>',
'cid' => '5',
'module' => 'media_mover_ftp',
'action' => '2',
'verb' => 'storage'
);
$configuration->storage->cid = '5';
$configuration->complete->module = 'mm_dir';
$configuration->complete->action = '3';
$configuration->complete->configuration = array(
'path' => '/var/www/drupal/sites/default/files/torrent-noruszaj/seed',
'cid' => '5',
'module' => 'mm_dir',
'action' => '3',
'verb' => 'complete'
);
$configuration->complete->cid = '5';
$configuration->hierarchy->parent = '0';
and my .sh looks like that:
#! /bin/sh
/var/www/torrent/bin/clients/tornado/btmakemetafile.py http://test-tracker.tutturu.bzzz.net:80/announce.php $1 --comment Tutturu!
done
when i run cron.php i get:
Fatal error: Call to undefined function token_replace() in /var/www/drupal/modules/mm_custom_command/mm_custom_command.module on line 132
process stops on the "process" phase and command is not being executed. I dont use the tokens method.
please help
Comments
Comment #1
anantagati commentedDo you have installed Token module? Media Mover Custom Command is dependent on mm_token module which in my opinion should require to install token.module. Installing of Token module should solve problem for you. I posted issue #373588: MM_token should have dependency on Token module
For good function of mm_token module there is need to install this patch #342377: Media Mover API Token - hook_token_values() has bad name. You are welcome to review patch, so it will be faster commited.
If is problem for you to apply patch, look here: http://drupal.org/node/60108
or just change following line in media_mover/contrib/mm_token.module
function mm_token_values($type, $object = NULL) {to
function mm_token_token_values($type, $object = NULL) {In your case you need to set also 'output_file', file which will be output from your command. For example to: [harvest_file].torrent
Comment #2
szczym commentedthe command worked after i installed the token module, i did a review of #373588: MM_token should have dependency on Token module
but i dont know what about the #342377: Media Mover API Token - hook_token_values() has bad name , i installed the patch but actually dont know if it helped in my issue
cheers, thanks for the code !
Comment #3
anantagati commentedThank you for info. Marking as fixed.