print "intro-title-movie processing done";
//move processed render_dir to archive dir
rename($render_dir, $render_root_path . '/processed/' . basename($render_dir));
// delete video files that are already in the repository (original cam and slide)
foreach (glob($render_root_path . '/processed/' . basename($render_dir) . '/*') as $f) {
    if ((strpos($f, "cam") !== false || strpos($f, "slide") !== false) && !strpos($f, "xml")) {
        unlink($f);
    }
}
$asset_meta = ezmam_asset_metadata_get($album, $asset);
//if we found the duration of the encoded videos set the asset's duration
if (isset($duration) && is_numeric($duration)) {
    $asset_meta['duration'] = round($duration);
}
$asset_meta['status'] = 'processed';
$res = ezmam_asset_metadata_set($album, $asset, $asset_meta);
if (!$res) {
    print "asset metadata set error:" . ezmam_last_error() . "\n";
}
function high_low_media_mam_insert($album, $asset, $high_low, $cam_slide, $processing_assoc, $render_dir)
{
    global $title, $duration;
    //get qtinfo assoc info
    $qtinfo_assoc = metadata2assoc_array($render_dir . "/{$high_low}_{$cam_slide}_qtinfo.xml");
    if (!is_array($qtinfo_assoc)) {
        myerror("error in intro-title-movie {$high_low}_{$cam_slide}_qtinfo.xml missing/corrupted");
    }
    //first copy most of the parameters from original media
    $movie_filename = $high_low . '_' . $cam_slide . '.mov';
    $media_meta['duration'] = $qtinfo_assoc['duration'];
    if (isset($qtinfo_assoc['duration'])) {
Example #2
0
function asset_downloadable_set()
{
    global $input;
    global $repository_path;
    if (!isset($input['album']) || !isset($input['asset']) || !isset($input['downloadable'])) {
        die;
    }
    ezmam_repository_path($repository_path);
    $metadata = ezmam_asset_metadata_get($input['album'], $input['asset']);
    $metadata['downloadable'] = $input['downloadable'];
    $res = ezmam_asset_metadata_set($input['album'], $input['asset'], $metadata);
    if (!$res) {
        error_print_message(ezmam_last_error());
        die;
    }
}
Example #3
0
/**
 *
 * @param string $album_name
 * @param string $asset_name
 * @param assoc_array $metadata
 * @return false|error_string
 * @desc creates an asset container in the given album
 */
function ezmam_asset_new($album_name, $asset_name, $metadata)
{
    $repository_path = ezmam_repository_path();
    if ($repository_path === false) {
        return false;
    }
    //create directory
    $asset_path = $repository_path . "/" . $album_name . "/" . $asset_name;
    if (!ezmam_album_exists($album_name)) {
        return "album non existant";
    }
    if (ezmam_asset_exists($album_name, $asset_name)) {
        return "asset already exists";
    }
    $res = mkdir($asset_path);
    if (!$res) {
        ezmam_last_error("ezmam_asset_new could not create {$asset_path}");
        return false;
    }
    //create the metadata
    $res = ezmam_asset_metadata_set($album_name, $asset_name, $metadata);
    if (!$res) {
        return "could not update metadata for {$asset_path}";
    }
    // Create a token
    $res = ezmam_asset_token_create($album_name, $asset_name);
    if (!$res) {
        return "could not create token for {$asset_path}";
    }
    // Log
    log_append('asset_new', 'Asset: ' . $asset_name . ', Album: ' . $album_name);
    // Rebuild RSSes
    ezmam_rss_generate($album_name, 'high');
    ezmam_rss_generate($album_name, 'low');
    return $res;
}