Ticket #4212: mythweb_video.22.patch
File mythweb_video.22.patch, 3.3 KB (added by , 15 years ago) |
---|
-
mythweb/classes/Video.php
a b 66 66 // Figure out the URL 67 67 $this->url = '#'; 68 68 if (file_exists('data/video/')) 69 { 70 $mythvideo_dir_ar = split(":", $mythvideo_dir); 71 $i = 1; 72 foreach ($mythvideo_dir_ar as &$path) { 73 $path = '#^' . $path . '/?#'; 74 $video_path[$i - 1] = "video$i/"; 75 $i++; 76 } 77 unset($path); 78 $video_path[0] = 'video/'; 79 69 80 $this->url = implode('/', array_map('rawurlencode', 70 81 array_map('utf8tolocal', 71 explode('/', 72 'data/video/' . preg_replace('#^'.$mythvideo_dir.'/?#', '', $this->filename) 73 )))); 82 explode('/', 'data/' . 83 preg_replace($mythvideo_dir_ar, $video_path, $this->filename) )))); 84 } 85 74 86 $genre = $db->query('SELECT videometadatagenre.idgenre 75 87 FROM videometadatagenre 76 88 WHERE videometadatagenre.idvideo = ?', -
mythweb/modules/video/handler.php
a b 32 32 } 33 33 34 34 // Make sure the video directory exists 35 if (file_exists('data/video')) { 35 $mythvideo_dir_ar = split(":", $mythvideo_dir); 36 $i = 1; 37 38 foreach ($mythvideo_dir_ar as $path) { 39 $datapath = 'data/video' . ($i == 1 ? "" : "$i"); 40 41 if (file_exists($datapath)) { 36 42 // File is not a directory or a symlink 37 if (!is_dir( 'data/video') && !is_link('data/video')) {38 custom_error( 'An invalid file exists at data/video. Please remove it in'43 if (!is_dir($datapath) && !is_link($datapath)) { 44 custom_error("An invalid file exists at $datapath. Please remove it in" 39 45 .' order to use the video portions of MythWeb.'); 40 46 } 41 47 } 42 48 // Create the symlink, if possible. 43 49 else { 44 if ($ mythvideo_dir) {50 if ($path) { 45 51 // You can't symlink on windows 46 52 if (strtoupper(substr(php_uname('s'), 0, 3)) != 'WIN') { 47 $ret = @symlink($ mythvideo_dir, 'data/video');53 $ret = @symlink($path, $datapath); 48 54 if (!$ret) { 49 custom_error("Could not create a symlink to $ mythvideo_dir, the local MythVideo"55 custom_error("Could not create a symlink to $path, the local MythVideo" 50 56 .' directory for this hostname ('.hostname.'). Please create a' 51 . ' symlink to your MythVideo directory at data/video in order to'57 ." symlink to your MythVideo directory at $datapath in order to" 52 58 .' use the video portions of MythWeb.'); 53 59 } 54 60 } … … 60 66 .' to point to the correct location.'); 61 67 } 62 68 } 69 $i++; } 63 70 64 71 // Make sure the video covers directory exists 65 72 if (file_exists('data/video_covers')) {