diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-05-15 13:26:30 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-05-15 13:26:30 +0000 |
commit | 809a3fc72ff5829b683a9167d6230e5fa101b6d3 (patch) | |
tree | 59aa3baab20b18554980f937bbe026bcbd5ba4ce | |
parent | 4259d662decc9f128519daf7b46d975bd72f5320 (diff) | |
download | ampache-809a3fc72ff5829b683a9167d6230e5fa101b6d3.tar.gz ampache-809a3fc72ff5829b683a9167d6230e5fa101b6d3.tar.bz2 ampache-809a3fc72ff5829b683a9167d6230e5fa101b6d3.zip |
add download for video that does not work, and most likely break song downloads \o/
-rw-r--r-- | lib/class/stream.class.php | 21 | ||||
-rw-r--r-- | lib/class/update.class.php | 11 | ||||
-rw-r--r-- | stream.php | 3 | ||||
-rw-r--r-- | templates/show_video_row.inc.php | 5 | ||||
-rw-r--r-- | templates/show_videos.inc.php | 6 |
5 files changed, 34 insertions, 12 deletions
diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php index 8b298917..0384a991 100644 --- a/lib/class/stream.class.php +++ b/lib/class/stream.class.php @@ -554,16 +554,19 @@ class Stream { */ private function create_download() { - // Build up our object - $song_id = $this->media['0']; - $url = Song::play_url($song_id); - - // Append the fact we are downloading - $url .= '&action=download'; + // There should only be one here... + foreach ($this->media as $element) { + $type = array_shift($element); + $media = new $type(array_shift($element)); + $url = call_user_func(array($type,'play_url'),$media->id); + + // Append the fact we are downloading + $url .= '&action=download'; - // Header redirect baby! - header("Location: $url"); - exit; + // Header redirect baby! + header("Location: $url"); + exit; + } } //create_download diff --git a/lib/class/update.class.php b/lib/class/update.class.php index 19795510..57283f56 100644 --- a/lib/class/update.class.php +++ b/lib/class/update.class.php @@ -1756,6 +1756,17 @@ class Update { } // update_350008 + /** + * update_360001 + * This adds the mbid id's to the different tables as well as some additional cleanup + */ + public static function update_360001() { + + + + + } // update_360001 + } // end update class ?> @@ -116,7 +116,7 @@ switch ($_REQUEST['action']) { $urls = array($democratic->play_url()); break; case 'download': - $media_ids[] = $_REQUEST['song_id']; + $media_ids[] = $_REQUEST['song_id']; default: break; } // end action switch @@ -131,6 +131,7 @@ switch ($_REQUEST['method']) { // Run the access check and exit if they are not allowed to download if (!Access::check_function('batch_download')) { access_denied(); exit; } + // Format the zip file $name = "AmpacheZip-" . date("m-d-Y",time()); $song_files = get_song_files($media_ids); diff --git a/templates/show_video_row.inc.php b/templates/show_video_row.inc.php index 1b650360..7323b531 100644 --- a/templates/show_video_row.inc.php +++ b/templates/show_video_row.inc.php @@ -27,3 +27,8 @@ <td class="cel_resolution"><?php echo $video->f_resolution; ?></td> <td class="cel_length"><?php echo $video->f_length; ?></td> <td class="cel_tags"><?php $video->f_tags; ?></td> +<td class="cel_action"> +<?php if (Access::check_function('download')) { ?> + <a href="<?php echo Config::get('web_path'); ?>/stream.php?action=download&type=video&oid=<?php echo $video->id; ?>"><?php echo get_user_icon('download',_('Download')); ?></a> +<?php } ?> +</td> diff --git a/templates/show_videos.inc.php b/templates/show_videos.inc.php index f45b3218..ea85559a 100644 --- a/templates/show_videos.inc.php +++ b/templates/show_videos.inc.php @@ -30,6 +30,7 @@ $web_path = Config::get('web_path'); <col id="col_resolution" /> <col id="col_length" /> <col id="col_tags" /> + <col id="col-action" /> </colgroup> <tr class="th-top"> <th class="cel_add"><?php echo _('Add'); ?></th> @@ -38,6 +39,7 @@ $web_path = Config::get('web_path'); <th class="cel_resolution"><?php echo Ajax::text('?page=browse&action=set_sort&type=video&sort=resolution',_('Resolution'),'sort_video_rez'); ?></th> <th class="cel_length"><?php echo Ajax::text('?page=browse&action=set_sort&type=video&sort=length',_('Time'),'sort_video_length'); ?></th> <th class="cel_tags"><?php echo _('Tags'); ?></th> + <th class="cel_action"><?php echo _('Action'); ?></th> </tr> <?php /* Foreach through every artist that has been passed to us */ @@ -51,7 +53,7 @@ foreach ($object_ids as $video_id) { <?php } //end foreach ?> <?php if (!count($object_ids)) { ?> <tr class="<?php echo flip_class(); ?>"> - <td colspan="6"><span class="fatalerror"><?php echo _('Not Enough Data'); ?></span></td> + <td colspan="7"><span class="fatalerror"><?php echo _('Not Enough Data'); ?></span></td> </tr> <?php } ?> <tr class="th-bottom"> @@ -61,7 +63,7 @@ foreach ($object_ids as $video_id) { <th class="cel_resolution"><?php echo _('Resolution'); ?></th> <th class="cel_length"><?php echo Ajax::text('?page=browse&action=set_sort&type=video&sort=length',_('Time'),'sort_video_length_bottom'); ?></th> <th class="cel_tags"><?php echo _('Tags'); ?></th> - + <th class="cel_action"><?php echo _('Action'); ?></th> </tr> </table> <?php require Config::get('prefix') . '/templates/list_header.inc.php'; ?> |