Changeset 1095
- Timestamp:
- 10/06/08 01:30:52 (9 months ago)
- Files:
-
- trunk/swisscenter/base/browse.php (modified) (3 diffs)
- trunk/swisscenter/base/capabilities.php (modified) (2 diffs)
- trunk/swisscenter/base/categories.php (modified) (1 diff)
- trunk/swisscenter/base/media.php (modified) (5 diffs)
- trunk/swisscenter/base/page.php (modified) (2 diffs)
- trunk/swisscenter/base/playlist.php (modified) (1 diff)
- trunk/swisscenter/base/search.php (modified) (2 diffs)
- trunk/swisscenter/base/settings.php (modified) (1 diff)
- trunk/swisscenter/config/config_dirs.php (modified) (3 diffs)
- trunk/swisscenter/config/config_movie.php (modified) (7 diffs)
- trunk/swisscenter/database/patch_0026.sql (added)
- trunk/swisscenter/gen_playlist.php (modified) (1 diff)
- trunk/swisscenter/images/style.ini (modified) (2 diffs)
- trunk/swisscenter/index.php (modified) (3 diffs)
- trunk/swisscenter/lang/en/en.xml (modified) (2 diffs)
- trunk/swisscenter/media_dir_refresh.php (modified) (1 diff)
- trunk/swisscenter/media_search.php (modified) (2 diffs)
- trunk/swisscenter/video.php (modified) (5 diffs)
- trunk/swisscenter/video_delete.php (modified) (1 diff)
- trunk/swisscenter/video_dvd.php (deleted)
- trunk/swisscenter/video_dvd_browse.php (deleted)
- trunk/swisscenter/video_dvd_search.php (deleted)
- trunk/swisscenter/video_dvd_selected.php (deleted)
- trunk/swisscenter/video_selected.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/swisscenter/base/browse.php
r1049 r1095 173 173 $width = style_value("MENU_WEB_WIDTH"); 174 174 $align = style_value("MENU_WEB_ALIGN"); 175 break;176 case MEDIA_TYPE_DVD :177 $width = style_value("MENU_DVD_WIDTH");178 $align = style_value("MENU_DVD_ALIGN");179 175 break; 180 176 default : … … 297 293 $align = style_value("MENU_WEB_ALIGN"); 298 294 break; 299 case MEDIA_TYPE_DVD :300 $width = style_value("MENU_DVD_WIDTH");301 $align = style_value("MENU_DVD_ALIGN");302 break;303 295 default : 304 296 $width = 650; … … 413 405 414 406 // Should we present a link to select all files? 415 if ($media_type > 0 && !in_array($media_type, array(MEDIA_TYPE_WEB, MEDIA_TYPE_RADIO , MEDIA_TYPE_DVD)))407 if ($media_type > 0 && !in_array($media_type, array(MEDIA_TYPE_WEB, MEDIA_TYPE_RADIO))) 416 408 $buttons[] = array('text'=>str('SELECT_ALL'), 'url'=> output_link( '%/'.$dir) ); 417 409 trunk/swisscenter/base/capabilities.php
r1083 r1095 107 107 { 108 108 // IP addresses of all connected NMT's 109 $nmt = db_col_to_list("select ip_address from clients where box_id like '%POP%'"); 109 $nmt = db_col_to_list("select ip_address from clients where box_id like '%POP%' or box_id like '%QPG%' ". 110 "or box_id like '%HDD%' or box_id like '%EGR%'"); 110 111 $shares = array(); 111 112 foreach ( $nmt as $ip ) … … 251 252 case MEDIA_TYPE_MUSIC : return media_exts_music(); break; 252 253 case MEDIA_TYPE_PHOTO : return media_exts_photos(); break; 253 case MEDIA_TYPE_VIDEO : return media_exts_movies(); break;254 case MEDIA_TYPE_VIDEO : return array_merge(media_exts_movies(), media_exts_dvd()); break; 254 255 case MEDIA_TYPE_WEB : return media_exts_web(); break; 255 256 case MEDIA_TYPE_TV : return media_exts_movies(); break; 256 case MEDIA_TYPE_DVD : return media_exts_dvd(); break;257 257 } 258 258 trunk/swisscenter/base/categories.php
r1049 r1095 95 95 $width = style_value("MENU_WEB_WIDTH"); 96 96 $align = style_value("MENU_WEB_ALIGN"); 97 break;98 case MEDIA_TYPE_DVD :99 $width = style_value("MENU_VIDEO_WIDTH");100 $align = style_value("MENU_VIDEO_ALIGN");101 97 break; 102 98 default : trunk/swisscenter/base/media.php
r1076 r1095 71 71 ' using viewings left outer join movies '. 72 72 ' on viewings.media_id = movies.file_id '. 73 ' where viewings.media_type in ('.MEDIA_TYPE_VIDEO.','.MEDIA_TYPE_DVD.')and movies.file_id is null');73 ' where viewings.media_type = '.MEDIA_TYPE_VIDEO.' and movies.file_id is null'); 74 74 75 75 @db_sqlcommand('delete from viewings '. … … 773 773 */ 774 774 775 function process_movie( $dir, $id, $file )775 function process_movie( $dir, $id, $file ) 776 776 { 777 777 send_to_log(4,'Found Video : '.$file); … … 1132 1132 */ 1133 1133 1134 function process_media_directory( $dir, $id, $ table, $file_exts, $recurse = true, $update = false)1134 function process_media_directory( $dir, $id, $share, $table, $file_exts, $recurse = true, $update = false) 1135 1135 { 1136 1136 // Standard files to ignore (lowercase only - case insensitive match). … … 1156 1156 1157 1157 if ($recurse) 1158 process_media_directory( $dir.$file.'/', $id, $ table, $file_exts, $recurse, $update);1158 process_media_directory( $dir.$file.'/', $id, $share, $table, $file_exts, $recurse, $update); 1159 1159 } 1160 1160 } … … 1166 1166 { 1167 1167 case 'mp3s' : process_mp3 ( $dir, $id, $file); break; 1168 case 'movies' : process_movie ( $dir, $id, $file); break; 1168 case 'movies' : 1169 // Do not include VOB's if a Network Share is defined for this location, they will be included with IFO. 1170 if ( empty($share) && !(file_ext($file)=='vob') ) 1171 process_movie ( $dir, $id, $file ); 1172 break; 1169 1173 case 'photos' : process_photo ( $dir, $id, $file); break; 1170 1174 case 'tv' : process_tv ( $dir, $id, $file); break; trunk/swisscenter/base/page.php
r1061 r1095 106 106 case MEDIA_TYPE_TV : if (style_img_exists("PAGE_TV")) $page_background = style_img("PAGE_TV"); break; 107 107 case MEDIA_TYPE_WEB : if (style_img_exists("PAGE_WEB")) $page_background = style_img("PAGE_WEB"); break; 108 case MEDIA_TYPE_DVD : if (style_img_exists("PAGE_DVD")) $page_background = style_img("PAGE_DVD"); break;109 108 } 110 109 } … … 283 282 pc_nav_button(str('PC_LINK_CONFIG') , '/config/index.php'). 284 283 pc_nav_button(str('PC_LINK_MUSIC') , '/music.php'). 285 pc_nav_button(str('PC_LINK_MOVIES') , '/index.php?submenu=video'). 284 pc_nav_button(str('PC_LINK_MOVIES') , '/video.php'). 285 pc_nav_button(str('PC_LINK_TV') , '/tv.php'). 286 286 pc_nav_button(str('PC_LINK_INTERNET'),'/index.php?submenu=internet'). 287 287 pc_nav_button(str('PC_LINK_PHOTOS') , '/photo.php'). trunk/swisscenter/base/playlist.php
r1046 r1095 233 233 break; 234 234 235 case MEDIA_TYPE_DVD:236 $data = db_toarray("select m.dirname, m.filename, ml.name, ml.network_share from movies m, media_locations ml where file_id=$file_id and m.location_id=ml.location_id");237 // If DVD Video then pass folder name238 if ( strtoupper($data[0]["FILENAME"]) == 'VIDEO_TS.IFO' )239 $file = rtrim($data[0]["DIRNAME"],'/');240 else241 $file = $data[0]["DIRNAME"].$data[0]["FILENAME"];242 $file = str_replace($data[0]["NAME"], "", $file);243 // Can't use gen_playlist as the PCH does something different with zcd=2.244 $link = 'href="file:///opt/sybhttpd/localhost.drives/'.$data[0]["NETWORK_SHARE"].$file.'" zcd="2" ';245 break;246 235 } 247 236 trunk/swisscenter/base/search.php
r1049 r1095 183 183 $buttons[] = array('text'=>str('SEARCH_ANYWHERE'), 'url'=>url_add_param($this_url,'any','%') ); 184 184 $buttons[] = array('text'=>str('SEARCH_CLEAR'), 'url'=>url_add_param($this_url,'search','') ); 185 if ( $media_type !== MEDIA_TYPE_DVD ) 186 $buttons[] = array('text'=>str('SELECT_ALL'), 'url'=>url_set_param($choose_url,'name',rawurlencode($search.'%')) ); 185 $buttons[] = array('text'=>str('SELECT_ALL'), 'url'=>url_set_param($choose_url,'name',rawurlencode($search.'%')) ); 187 186 } 188 187 else … … 190 189 $buttons[] = array('text'=>str('SEARCH_START'), 'url'=>url_add_param($this_url,'any','') ); 191 190 $buttons[] = array('text'=>str('SEARCH_CLEAR'), 'url'=>url_add_param($this_url,'search','') ); 192 if ( $media_type !== MEDIA_TYPE_DVD ) 193 $buttons[] = array('text'=>str('SELECT_ALL'), 'url'=>url_set_param($choose_url,'name',rawurlencode('%'.$search.'%')) ); 191 $buttons[] = array('text'=>str('SELECT_ALL'), 'url'=>url_set_param($choose_url,'name',rawurlencode('%'.$search.'%')) ); 194 192 } 195 193 trunk/swisscenter/base/settings.php
r1045 r1095 25 25 define('MEDIA_TYPE_WEB',5); 26 26 define('MEDIA_TYPE_TV',6); 27 define('MEDIA_TYPE_DVD',7);28 27 29 28 define('THUMBNAIL_X_SIZE',130); trunk/swisscenter/config/config_dirs.php
r1067 r1095 33 33 $share_list[$share_opts[$i]["name"]] = $share_opts[$i]["path"]; 34 34 } 35 $share_sql_case .= "ELSE ' ".str('PLEASE_SELECT')."' END) ";35 $share_sql_case .= "ELSE '' END) "; 36 36 } 37 37 else 38 38 { 39 $share_sql_case = "' ".str('PLEASE_SELECT')."' ";39 $share_sql_case = "'' "; 40 40 } 41 41 $share_opts = array_merge(array(array("path"=>'', "name"=>'')), $share_opts); 42 42 43 43 $data = db_toarray("select location_id,media_name 'Type', cat_name 'Category', cert.name 'Certificate', ml.name 'Directory', ". 44 "(CASE media_ name WHEN 'DVD Video'THEN ".$share_sql_case."ELSE '' END) 'Share' ".44 "(CASE media_id WHEN ".MEDIA_TYPE_VIDEO." THEN ".$share_sql_case."ELSE '' END) 'Share' ". 45 45 "from media_locations ml, media_types mt, categories cat, certificates cert ". 46 46 "where ml.unrated=cert.cert_id and mt.media_id = ml.media_type and ml.cat_id = cat.cat_id order by 2,3,4"); … … 155 155 elseif (empty($dir)) 156 156 dirs_display('',"!".str('MEDIA_LOC_ERROR_LOC')); 157 elseif (empty($share) && $type_id==MEDIA_TYPE_DVD)158 dirs_display('',"!".str('MEDIA_LOC_ERROR_SHARE'));159 157 elseif (!file_exists($dir)) 160 158 { … … 250 248 elseif (empty($_REQUEST["location"])) 251 249 dirs_display('',"!".str('MEDIA_LOC_ERROR_LOC')); 252 elseif (empty($share) && $_REQUEST["type"]==MEDIA_TYPE_DVD)253 dirs_display('',"!".str('MEDIA_LOC_ERROR_SHARE'));254 250 elseif (!file_exists($dir)) 255 251 { trunk/swisscenter/config/config_movie.php
r1057 r1095 166 166 foreach ($movie_list as $movie) 167 167 { 168 $media_type = db_value("select media_type from media_locations ml, movies m where ml.location_id=m.location_id and m.file_id=".$movie["FILE_ID"]);169 168 $actors = db_col_to_list("select actor_name from actors a,actors_in_movie aim where a.actor_id=aim.actor_id ". 170 169 "and movie_id=$movie[FILE_ID] order by 1"); … … 182 181 Year : '.nvl($movie["YEAR"]).'<br> 183 182 Viewed by : '.implode(', ',db_col_to_list("select u.name from users u, viewings v where ". 184 "v.user_id=u.user_id and v.media_type= $media_typeand v.media_id=".$movie["FILE_ID"])).'183 "v.user_id=u.user_id and v.media_type=".MEDIA_TYPE_VIDEO." and v.media_id=".$movie["FILE_ID"])).' 185 184 </td> 186 185 <td valign="top" width="21%">'.nvl(implode("<br>",$actors)).'</td> … … 270 269 form_hidden('last_where',$where); 271 270 echo str('CATEGORY').' : 272 '.form_list_dynamic_html("cat_id","select distinct c.cat_id,c.cat_name from categories c left join media_locations ml on c.cat_id=ml.cat_id where ml.media_type=".MEDIA_TYPE_VIDEO." or ml.media_type=".MEDIA_TYPE_DVD." order by c.cat_name",$_REQUEST["cat_id"],true,true,str('CATEGORY_LIST_ALL')).' 271 '.form_list_dynamic_html("cat_id","select distinct c.cat_id,c.cat_name from categories c left join media_locations ml on c.cat_id=ml.cat_id where ml.media_type=".MEDIA_TYPE_VIDEO." order by c.cat_name",$_REQUEST["cat_id"],true,true,str('CATEGORY_LIST_ALL')).' 273 272 <a href="'.url_set_param($this_url,'list','LIST').'"><img align="absbottom" border="0" src="/images/details.gif"></a> 274 273 <a href="'.url_set_param($this_url,'list','THUMBS').'"><img align="absbottom" border="0" src="/images/thumbs.gif"></a> … … 363 362 // Get actor/director/genre lists 364 363 $movie_id = $_REQUEST["movie"][0]; 365 $media_type = db_value("select media_type from media_locations ml, movies m where ml.location_id=m.location_id and m.file_id=$movie_id");366 364 $details = db_toarray("select * from movies where file_id=".$movie_id); 367 365 $actors = db_toarray("select actor_name name, actor_id id from actors order by 1"); … … 422 420 foreach ( db_toarray("select * from users order by name") as $row) 423 421 echo '<input type="checkbox" name="viewed[]" value="'.$row["USER_ID"].'" '. 424 (viewings_count( $media_type, $details[0]["FILE_ID"], $row["USER_ID"])>0 ? 'checked' : '').422 (viewings_count( MEDIA_TYPE_VIDEO, $details[0]["FILE_ID"], $row["USER_ID"])>0 ? 'checked' : ''). 425 423 '>'.$row["NAME"].'<br>'; 426 424 … … 575 573 foreach ($movie_list as $movie) 576 574 { 577 $media_type = db_value("select media_type from media_locations ml, movies m where ml.location_id=m.location_id and m.file_id=$movie"); 578 if (viewings_count($media_type, $movie, $row["USER_ID"]) == 0) 579 db_insert_row('viewings',array("user_id"=>$row["USER_ID"], "media_type"=>$media_type, "media_id"=>$movie, "total_viewings"=>1)); 575 if (viewings_count(MEDIA_TYPE_VIDEO, $movie, $row["USER_ID"]) == 0) 576 db_insert_row('viewings',array("user_id"=>$row["USER_ID"], "media_type"=>MEDIA_TYPE_VIDEO, "media_id"=>$movie, "total_viewings"=>1)); 580 577 } 581 578 } … … 583 580 { 584 581 // Remove all viewing information about these movies for this user 585 db_sqlcommand("delete from viewings where media_type in (".MEDIA_TYPE_VIDEO.",".MEDIA_TYPE_DVD.")and user_id=$row[USER_ID] ".582 db_sqlcommand("delete from viewings where media_type=".MEDIA_TYPE_VIDEO." and user_id=$row[USER_ID] ". 586 583 "and media_id in (".implode(',',$movie_list).")"); 587 584 } trunk/swisscenter/gen_playlist.php
r1046 r1095 74 74 if ($media_type == MEDIA_TYPE_VIDEO || $media_type == MEDIA_TYPE_TV ) // Movie 75 75 { 76 // Record the fact the movie was viewed. 77 store_request_details( $media_type, $file_id); 78 79 send_to_log(7,'Attempting to stream the following video',array( "File ID"=>$file_id, "Media Type"=>$media_type, "Location"=>$row["DIRNAME"].$row["FILENAME"] )); 80 $url = $server.make_url_path($row["DIRNAME"].$row["FILENAME"]); 81 } 82 elseif ($media_type == MEDIA_TYPE_DVD ) // DVD Video - THIS IS NOT USED!! 83 { 84 // Record the fact the dvd was viewed. 85 store_request_details( $media_type, $file_id); 86 87 // Get the SMB/NFS network share reference 88 $data = db_toarray("select m.dirname, m.filename, ml.name, ml.network_share from movies m, media_locations ml where file_id=$file_id and m.location_id=ml.location_id"); 89 // If DVD Video then pass folder name 90 if ( strtoupper($data[0]["FILENAME"]) == 'VIDEO_TS.IFO' ) 91 $file = rtrim($data[0]["DIRNAME"],'/'); 76 // Do not add DVD images to the playlist 77 if ( in_array(file_ext($row["FILENAME"]), media_exts_dvd()) ) 78 { 79 send_to_log(5,'Cannot stream DVD image from a playlist',array( "File ID"=>$file_id, "Media Type"=>$media_type, "Location"=>$row["DIRNAME"].$row["FILENAME"] )); 80 $url=''; 81 } 92 82 else 93 $file = $data[0]["DIRNAME"].$data[0]["FILENAME"]; 94 $file = str_replace($data[0]["NAME"], "", $file); 95 96 send_to_log(7,'Attempting to play the following dvd',array( "File ID"=>$file_id, "Media Type"=>$media_type, "Location"=>$row["DIRNAME"].$row["FILENAME"] )); 97 $url = 'file:///opt/sybhttpd/localhost.drives/'.$data[0]["NETWORK_SHARE"].$file; 83 { 84 // Record the fact the movie was viewed. 85 store_request_details( $media_type, $file_id); 86 87 send_to_log(7,'Attempting to stream the following video',array( "File ID"=>$file_id, "Media Type"=>$media_type, "Location"=>$row["DIRNAME"].$row["FILENAME"] )); 88 $url = $server.make_url_path($row["DIRNAME"].$row["FILENAME"]); 89 } 98 90 } 99 91 else 100 92 $url = $server.'stream.php?'.current_session().'&tracklist='.$tracklist.'&media_type='.$media_type.'&idx='.$item_count.'&ext=.'.file_ext($row["FILENAME"]); 101 93 102 // Build up the playlist row to send to the player, including the title of the movie (for the on-screen display) 103 $title = rtrim(nvl( $row["TITLE"] , file_noext(basename($row["FILENAME"])) )); 104 send_to_log(7," - ".$url); 94 if (!empty($url)) 95 { 96 // Build up the playlist row to send to the player, including the title of the movie (for the on-screen display) 97 $title = rtrim(nvl( $row["TITLE"] , file_noext(basename($row["FILENAME"])) )); 98 send_to_log(7," - ".$url); 99 100 if (is_hardware_player()) 101 echo $title.'|'.$start_pos.'|0|'.$url."|\n"; 102 else 103 echo $url.newline(); 105 104 106 if (is_hardware_player()) 107 echo $title.'|'.$start_pos.'|0|'.$url."|\n"; 108 else 109 echo $url.newline(); 110 111 $item_count++; 105 $item_count++; 106 } 112 107 } 113 108 trunk/swisscenter/images/style.ini
r1046 r1095 46 46 ;PAGE_TV = background.jpg 47 47 ;PAGE_WEB = background.jpg 48 ;PAGE_DVD = background.jpg49 48 50 49 PAGE_BACKGROUND_COLOUR = #000000 … … 148 147 MENU_WEB_ALIGN = center 149 148 MENU_WEB_WIDTH = 650 150 MENU_DVD_ALIGN = center151 MENU_DVD_WIDTH = 650152 149 MENU_CONFIG_ALIGN = center 153 150 MENU_CONFIG_WIDTH = 650 trunk/swisscenter/index.php
r1060 r1095 19 19 else 20 20 return false; 21 }22 23 /**24 * Display the Video submenu25 */26 function display_video_menu()27 {28 page_header( str('WATCH_MOVIE'),'','',1,false,'','PAGE_VIDEO');29 30 /**31 * Menu Items32 */33 $menu = new menu();34 $page = (empty($_REQUEST["page"]) ? 1 : $_REQUEST["page"]);35 36 // Only display the video options if the user has some videos stored in the database.37 if ( media_exists(MEDIA_TYPE_VIDEO))38 $menu->add_item(str('WATCH_MOVIE'),'video.php',true);39 40 // Only display the TV Series options if the user has some TV episodes stored in the database.41 if ( media_exists(MEDIA_TYPE_TV))42 $menu->add_item(str('WATCH_TV'),'tv.php',true);43 44 // Only display the DVD options if the user has some DVD images stored in the database.45 if ( media_exists(MEDIA_TYPE_DVD))46 $menu->add_item(str('WATCH_DVD'),'video_dvd.php',true);47 48 /**49 * Display the page content50 */51 if ($menu->num_items() == 1)52 header('Location: '.server_address().$menu->item_url(0));53 else54 $menu->display(1, style_value("MENU_VIDEO_WIDTH"), style_value("MENU_VIDEO_ALIGN"));55 56 page_footer('index.php');57 21 } 58 22 … … 79 43 && db_value("select 'YES' from media_locations where media_type=".MEDIA_TYPE_WEB." limit 1") == 'YES' ) 80 44 || get_sys_pref('OVERRIDE_ENABLE_WEBLINKS','NO') == 'YES') ) 81 $menu->add_item(str('BROWSE_WEB'),'web_urls.php',true);45 $menu->add_item(str('BROWSE_WEB'),'web_urls.php',true); 82 46 83 47 // Only display the RSS options if an internet connection is active, the user has enabled RSS support and has defined some subscriptions. … … 148 112 149 113 // Only display the video options if the user has some videos stored in the database. 150 if ( media_exists(MEDIA_TYPE_VIDEO) || media_exists(MEDIA_TYPE_TV) || media_exists(MEDIA_TYPE_DVD) ) 151 $menu->add_item(str('WATCH_MOVIE'),"index.php?submenu=video",true); 114 if ( media_exists(MEDIA_TYPE_VIDEO)) 115 $menu->add_item(str('WATCH_MOVIE'),'video.php',true); 116 117 // Only display the TV Series options if the user has some TV episodes stored in the database. 118 if ( media_exists(MEDIA_TYPE_TV)) 119 $menu->add_item(str('WATCH_TV'),'tv.php',true); 152 120 153 121 // Only display the music options if the user has some music stored in the database. trunk/swisscenter/lang/en/en.xml
r1084 r1095 2329 2329 <string> 2330 2330 <id>NETWORK_SHARE_PROMPT</id> 2331 <text>The network share is only required for the media type 'DVD Video', and will be ignored for all other media types. To play DVD Videos you must first setup a SMB or NFS network share on your NMT to allow access to your DVD images, then associate the network share with this media location.</text>2332 <version>1.2 0.1</version>2331 <text>The network share is only required if you have DVD images (iso, img, etc) in this media location, and can only be used with a NMT media player. To play DVD images you must first setup a SMB or NFS network share on your NMT to allow access to your DVD images, then associate the network share with this media location.</text> 2332 <version>1.21.1</version> 2333 2333 </string> 2334 2334 <string> … … 2419 2419 <string> 2420 2420 <id>ORG_TITLE</id> 2421 <text>Edit Video /DVDDetails</text>2422 <version>1.2 0.1</version>2421 <text>Edit Video Details</text> 2422 <version>1.21.1</version> 2423 2423 </string> 2424 2424 <string> trunk/swisscenter/media_dir_refresh.php
r820 r1095 23 23 $media_type = $_REQUEST["media_type"]; 24 24 $table = db_value("select media_table from media_types where media_id=$media_type"); 25 $types = media_exts( $media_type ); 26 $filetypes = media_exts( $media_type); 25 $filetypes = media_exts( $media_type ); 27 26 $media_locations = db_toarray("select * from media_locations where media_type=".$media_type); 28 27 29 28 foreach ($media_locations as $row) 30 process_media_directory( str_suffix($row["NAME"],'/').$dir , $row["LOCATION_ID"], $ table, $types);29 process_media_directory( str_suffix($row["NAME"],'/').$dir , $row["LOCATION_ID"], $row["NETWORK_SHARE"], $table, $filetypes); 31 30 32 31 header('Location: '.$rtn); trunk/swisscenter/media_search.php
r1063 r1095 40 40 $types = media_exts( $location["MEDIA_TYPE"] ); 41 41 send_to_log(4,'Refreshing '.strtoupper($table).' database'); 42 process_media_directory( str_suffix($location["NAME"],'/'), $location["LOCATION_ID"], $ table, $types, true, $update );42 process_media_directory( str_suffix($location["NAME"],'/'), $location["LOCATION_ID"], $location["NETWORK_SHARE"], $table, $types, true, $update ); 43 43 send_to_log(4,'Completed refreshing '.strtoupper($table).' database'); 44 44 … … 86 86 87 87 // Update video details from the Internet if enabled 88 if ( is_movie_check_enabled() && (in_array(MEDIA_TYPE_VIDEO, $media_types) || in_array(MEDIA_TYPE_DVD, $media_types)) )88 if ( is_movie_check_enabled() && in_array(MEDIA_TYPE_VIDEO, $media_types) ) 89 89 { 90 90 set_sys_pref('MEDIA_SCAN_STATUS',str('MEDIA_SCAN_STATUS_MOVIE')); trunk/swisscenter/video.php
r1001 r1095 16 16 search_hist_init( 'video.php', get_rating_filter().filter_get_predicate() ); 17 17 else 18 search_hist_init( 'video.php?cat='.$cat_id, category_select_sql($cat_id, 3).get_rating_filter().filter_get_predicate() );18 search_hist_init( 'video.php?cat='.$cat_id, category_select_sql($cat_id, MEDIA_TYPE_VIDEO).get_rating_filter().filter_get_predicate() ); 19 19 20 20 if ($cat_id <= 0) … … 22 22 else 23 23 $prev_page = "video.php?subcat=".db_value("select parent_id from categories where cat_id=$cat_id"); 24 24 25 25 echo '<p>'; 26 26 … … 30 30 if (get_sys_pref('browse_video_actor_enabled','YES') == 'YES') 31 31 $menu->add_item( str('BROWSE_ACTOR') ,"video_search.php?sort=actor",true); 32 if (get_sys_pref('browse_video_director_enabled','YES') == 'YES') 32 if (get_sys_pref('browse_video_director_enabled','YES') == 'YES') 33 33 $menu->add_item( str('BROWSE_DIRECTOR') ,"video_search.php?sort=director",true); 34 if (get_sys_pref('browse_video_genre_enabled','YES') == 'YES') 34 if (get_sys_pref('browse_video_genre_enabled','YES') == 'YES') 35 35 $menu->add_item( str('BROWSE_GENRE') ,"video_search.php?sort=genre",true); 36 if (get_sys_pref('browse_video_year_enabled','YES') == 'YES') 36 if (get_sys_pref('browse_video_year_enabled','YES') == 'YES') 37 37 $menu->add_item( str('BROWSE_YEAR') ,"video_search.php?sort=year",true); 38 if (get_sys_pref('browse_video_certificate_enabled','YES') == 'YES') 38 if (get_sys_pref('browse_video_certificate_enabled','YES') == 'YES') 39 39 $menu->add_item( str('BROWSE_CERTIFICATE') ,"video_search.php?sort=certificate",true); 40 if (get_sys_pref('browse_video_filesystem_enabled','YES') == 'YES') 40 if (get_sys_pref('browse_video_filesystem_enabled','YES') == 'YES') 41 41 $menu->add_item( str('BROWSE_FILESYSTEM') ,"video_browse.php",true); 42 42 43 43 if ($menu->num_items() == 1) 44 44 { 45 search_hist_init( $prev_page, category_select_sql($cat_id, 3).get_rating_filter().filter_get_predicate() );45 search_hist_init( $prev_page, category_select_sql($cat_id, MEDIA_TYPE_VIDEO).get_rating_filter().filter_get_predicate() ); 46 46 header('Location: '.server_address().$menu->item_url(0)); 47 } 47 } 48 48 else 49 49 { 50 50 $menu->display(1, style_value("MENU_VIDEO_WIDTH"), style_value("MENU_VIDEO_ALIGN")); 51 51 } 52 52 53 53 $buttons = array(); 54 54 $buttons[] = array('text' => str('QUICK_PLAY'),'url' => quick_play_link(MEDIA_TYPE_VIDEO,$_SESSION["history"][0]["sql"])); … … 61 61 page_footer($prev_page, $buttons ); 62 62 } 63 63 64 64 /************************************************************************************************** 65 65 Main page output … … 67 67 68 68 page_header( str('WATCH_MOVIE') , '','',1,false,'',MEDIA_TYPE_VIDEO); 69 69 70 70 if( category_count(MEDIA_TYPE_VIDEO)==1 || isset($_REQUEST["cat"]) ) 71 71 display_video_menu($_REQUEST["cat"]); 72 72 elseif ( isset($_REQUEST["subcat"]) ) 73 display_categories('video.php', 3, $_REQUEST["subcat"]);74 else 75 display_categories('video.php', 3);73 display_categories('video.php', MEDIA_TYPE_VIDEO, $_REQUEST["subcat"]); 74 else 75 display_categories('video.php', MEDIA_TYPE_VIDEO); 76 76 77 77 /************************************************************************************************** trunk/swisscenter/video_delete.php
r1046 r1095 24 24 case MEDIA_TYPE_TV : $media_table = 'tv' ; break; 25 25 case MEDIA_TYPE_VIDEO : 26 case MEDIA_TYPE_DVD :27 26 default : $media_table = 'movies'; break; 28 27 } trunk/swisscenter/video_selected.php
r1074 r1095 85 85 'left outer join directors d on dom.director_id = d.director_id '. 86 86 'left outer join genres g on gom.genre_id = g.genre_id'. 87 get_rating_join().' where 1=1 and ml.media_type='.MEDIA_TYPE_VIDEO;87 get_rating_join().' where 1=1 '; 88 88 $select_fields = "file_id, dirname, filename, title, year, length"; 89 89 $predicate = search_process_passed_params(); … … 99 99 $sql_table .= 'left outer join genres_of_movie gom on media.file_id = gom.movie_id '. 100 100 'left outer join genres g on gom.genre_id = g.genre_id '; 101 $sql_table .= get_rating_join().' where 1=1 and ml.media_type='.MEDIA_TYPE_VIDEO;101 $sql_table .= get_rating_join().' where 1=1 '; 102 102 $file_ids = db_col_to_list("select distinct media.file_id from $sql_table $predicate"); 103 103 $playtime = db_value("select sum(length) from movies where file_id in (".implode(',',$file_ids).")"); … … 115 115 { 116 116 // Single match, so get the details from the database and display them 117 if ( ($data = db_toarray("select media.*, ".get_cert_name_sql()." certificate_name from $sql_table $predicate")) === false)117 if ( ($data = db_toarray("select media.*, ml.name, ml.network_share, ".get_cert_name_sql()." certificate_name from $sql_table $predicate")) === false) 118 118 page_error( str('DATABASE_ERROR')); 119 119 … … 123 123 page_header( $data[0]["TITLE"] ); 124 124 125 // Is DVD image? 126 $is_dvd = in_array(file_ext($data[0]["FILENAME"]), media_exts_dvd()); 127 125 128 // Play now 126 $menu->add_item( str('PLAY_NOW') , play_sql_list(MEDIA_TYPE_VIDEO,"select distinct $select_fields from $sql_table $predicate order by title, filename")); 127 129 if ( $is_dvd ) 130 { 131 // If VIDEO_TS folder then pass folder name 132 if ( strtoupper($data[0]["FILENAME"]) == 'VIDEO_TS.IFO' ) 133 $file = rtrim($data[0]["DIRNAME"],'/'); 134 else 135 $file = $data[0]["DIRNAME"].$data[0]["FILENAME"]; 136 $file = str_replace($data[0]["NAME"], "", $file); 137 // Can't use gen_playlist as the NMT does something different with zcd=2. 138 $menu->add_item( str('PLAY_NOW') , 'href="file:///opt/sybhttpd/localhost.drives/'.$data[0]["NETWORK_SHARE"].$file.'" zcd="2" ' ); 139 } 140 else 141 $menu->add_item( str('PLAY_NOW') , play_sql_list(MEDIA_TYPE_VIDEO,"select distinct $select_fields from $sql_table $predicate order by title, filename")); 142 128 143 // Resume playing 129 if ( support_resume() && file_exists( bookmark_file($data[0]["DIRNAME"].$data[0]["FILENAME"]) ))144 if ( support_resume() && file_exists( bookmark_file($data[0]["DIRNAME"].$data[0]["FILENAME"]) && !$is_dvd )) 130 145 $menu->add_item( str('RESUME_PLAYING') , resume_file(MEDIA_TYPE_VIDEO,$data[0]["FILE_ID"]), true); 131 146 132 147 // Add to your current playlist 133 if (pl_enabled() )148 if (pl_enabled() && !$is_dvd) 134 149 $menu->add_item( str('ADD_PLAYLIST') ,'add_playlist.php?sql='.rawurlencode("select distinct $select_fields from $sql_table $predicate order by title, filename"),true); 135 150 … … 141 156 if ($data[0]["DETAILS_AVAILABLE"] == 'Y') 142 157 $menu->add_item( str('VIDEO_INFO'), 'video_info.php?movie='.$data[0]["FILE_ID"],true); 143 144 // Display thumbnail 145 $folder_img = file_albumart($data[0]["DIRNAME"].$data[0]["FILENAME"]); 146 } 147 148 // 149 // There are multiple movies which match the criteria enterede by the user. Therefore, we should 158 159 // Display thumbnail (DVD Video image will be in parent folder) 160 if ( strtoupper($data[0]["FILENAME"]) == 'VIDEO_TS.IFO' ) 161 $folder_img = file_albumart(rtrim($data[0]["DIRNAME"],'/').".dvd"); 162 else 163 $folder_img = file_albumart($data[0]["DIRNAME"].$data[0]["FILENAME"]); 164 } 165 166 // 167 // There are multiple movies which match the criteria entered by the user. Therefore, we should 150 168 // display the information that is common to all movies, and provide links to refine the search 151 169 // further.