Assembla home | Assembla project page
 

Changeset 1095

Show
Ignore:
Timestamp:
10/06/08 01:30:52 (9 months ago)
Author:
Pernod
Message:

Removed the Video submenu. Also merged the 'DVD Video' and 'Video' media types.

If multiple videos are selected via Quick Play or Add to Playlist then DVD images will NOT be included as they cannot be played from a playlist.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/swisscenter/base/browse.php

    r1049 r1095  
    173173        $width = style_value("MENU_WEB_WIDTH"); 
    174174        $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"); 
    179175        break; 
    180176      default               : 
     
    297293        $align = style_value("MENU_WEB_ALIGN"); 
    298294        break; 
    299       case MEDIA_TYPE_DVD   : 
    300         $width = style_value("MENU_DVD_WIDTH"); 
    301         $align = style_value("MENU_DVD_ALIGN"); 
    302         break; 
    303295      default               : 
    304296        $width = 650; 
     
    413405       
    414406    // 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))) 
    416408      $buttons[] = array('text'=>str('SELECT_ALL'), 'url'=>  output_link( '%/'.$dir) ); 
    417409       
  • trunk/swisscenter/base/capabilities.php

    r1083 r1095  
    107107{ 
    108108  // 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%'"); 
    110111  $shares = array(); 
    111112  foreach ( $nmt as $ip ) 
     
    251252    case MEDIA_TYPE_MUSIC : return media_exts_music();  break; 
    252253    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; 
    254255    case MEDIA_TYPE_WEB   : return media_exts_web();    break; 
    255256    case MEDIA_TYPE_TV    : return media_exts_movies(); break; 
    256     case MEDIA_TYPE_DVD   : return media_exts_dvd();    break; 
    257257  } 
    258258 
  • trunk/swisscenter/base/categories.php

    r1049 r1095  
    9595        $width = style_value("MENU_WEB_WIDTH"); 
    9696        $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"); 
    10197        break; 
    10298      default               : 
  • trunk/swisscenter/base/media.php

    r1076 r1095  
    7171                 ' using viewings left outer join movies '. 
    7272                 '    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'); 
    7474                  
    7575  @db_sqlcommand('delete from viewings '. 
     
    773773 */ 
    774774 
    775 function process_movie( $dir, $id, $file
     775function process_movie( $dir, $id, $file
    776776{ 
    777777  send_to_log(4,'Found Video    : '.$file); 
     
    11321132 */ 
    11331133 
    1134 function process_media_directory( $dir, $id, $table, $file_exts, $recurse = true, $update = false) 
     1134function process_media_directory( $dir, $id, $share, $table, $file_exts, $recurse = true, $update = false) 
    11351135{ 
    11361136  // Standard files to ignore (lowercase only - case insensitive match). 
     
    11561156 
    11571157          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); 
    11591159        } 
    11601160      } 
     
    11661166          { 
    11671167            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; 
    11691173            case 'photos' : process_photo ( $dir, $id, $file);  break; 
    11701174            case 'tv'     : process_tv    ( $dir, $id, $file);  break; 
  • trunk/swisscenter/base/page.php

    r1061 r1095  
    106106      case MEDIA_TYPE_TV    : if (style_img_exists("PAGE_TV"))    $page_background = style_img("PAGE_TV"); break; 
    107107      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; 
    109108    } 
    110109  } 
     
    283282         pc_nav_button(str('PC_LINK_CONFIG') , '/config/index.php'). 
    284283         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'). 
    286286         pc_nav_button(str('PC_LINK_INTERNET'),'/index.php?submenu=internet'). 
    287287         pc_nav_button(str('PC_LINK_PHOTOS') , '/photo.php'). 
  • trunk/swisscenter/base/playlist.php

    r1046 r1095  
    233233         break; 
    234234 
    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 name 
    238          if ( strtoupper($data[0]["FILENAME"]) == 'VIDEO_TS.IFO' ) 
    239            $file = rtrim($data[0]["DIRNAME"],'/'); 
    240          else 
    241            $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; 
    246235  } 
    247236 
  • trunk/swisscenter/base/search.php

    r1049 r1095  
    183183    $buttons[] = array('text'=>str('SEARCH_ANYWHERE'), 'url'=>url_add_param($this_url,'any','%') ); 
    184184    $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.'%')) ); 
    187186  } 
    188187  else 
     
    190189    $buttons[] = array('text'=>str('SEARCH_START'), 'url'=>url_add_param($this_url,'any','') ); 
    191190    $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.'%')) ); 
    194192  } 
    195193 
  • trunk/swisscenter/base/settings.php

    r1045 r1095  
    2525  define('MEDIA_TYPE_WEB',5); 
    2626  define('MEDIA_TYPE_TV',6); 
    27   define('MEDIA_TYPE_DVD',7); 
    2827   
    2928  define('THUMBNAIL_X_SIZE',130); 
  • trunk/swisscenter/config/config_dirs.php

    r1067 r1095  
    3333        $share_list[$share_opts[$i]["name"]] = $share_opts[$i]["path"]; 
    3434      } 
    35       $share_sql_case .= "ELSE '".str('PLEASE_SELECT')."' END) "; 
     35      $share_sql_case .= "ELSE '' END) "; 
    3636    } 
    3737    else 
    3838    { 
    39       $share_sql_case = "'".str('PLEASE_SELECT')."' "; 
     39      $share_sql_case = "'' "; 
    4040    } 
    4141    $share_opts = array_merge(array(array("path"=>'', "name"=>'')), $share_opts); 
    4242 
    4343    $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' ". 
    4545                       "from media_locations ml, media_types mt, categories cat, certificates cert ". 
    4646                       "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"); 
     
    155155      elseif (empty($dir)) 
    156156        dirs_display('',"!".str('MEDIA_LOC_ERROR_LOC')); 
    157       elseif (empty($share) && $type_id==MEDIA_TYPE_DVD) 
    158         dirs_display('',"!".str('MEDIA_LOC_ERROR_SHARE')); 
    159157      elseif (!file_exists($dir)) 
    160158      { 
     
    250248    elseif (empty($_REQUEST["location"])) 
    251249      dirs_display('',"!".str('MEDIA_LOC_ERROR_LOC')); 
    252     elseif (empty($share) && $_REQUEST["type"]==MEDIA_TYPE_DVD) 
    253       dirs_display('',"!".str('MEDIA_LOC_ERROR_SHARE')); 
    254250    elseif (!file_exists($dir)) 
    255251    { 
  • trunk/swisscenter/config/config_movie.php

    r1057 r1095  
    166166  foreach ($movie_list as $movie) 
    167167  { 
    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"]); 
    169168    $actors    = db_col_to_list("select actor_name from actors a,actors_in_movie aim where a.actor_id=aim.actor_id ". 
    170169                                "and movie_id=$movie[FILE_ID] order by 1"); 
     
    182181             Year : '.nvl($movie["YEAR"]).'<br> 
    183182             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_type and 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"])).' 
    185184           </td> 
    186185           <td valign="top" width="21%">'.nvl(implode("<br>",$actors)).'</td> 
     
    270269  form_hidden('last_where',$where); 
    271270  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')).'&nbsp; 
     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')).'&nbsp; 
    273272        <a href="'.url_set_param($this_url,'list','LIST').'"><img align="absbottom" border="0"  src="/images/details.gif"></a> 
    274273        <a href="'.url_set_param($this_url,'list','THUMBS').'"><img align="absbottom" border="0" src="/images/thumbs.gif"></a> 
     
    363362  // Get actor/director/genre lists 
    364363  $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"); 
    366364  $details     = db_toarray("select * from movies where file_id=".$movie_id); 
    367365  $actors      = db_toarray("select actor_name name, actor_id id from actors order by 1"); 
     
    422420  foreach ( db_toarray("select * from users order by name") as $row) 
    423421    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' : ''). 
    425423         '>'.$row["NAME"].'<br>'; 
    426424 
     
    575573        foreach ($movie_list as $movie) 
    576574        { 
    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)); 
    580577        } 
    581578      } 
     
    583580      { 
    584581        // 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] ". 
    586583                      "and media_id in (".implode(',',$movie_list).")"); 
    587584      } 
  • trunk/swisscenter/gen_playlist.php

    r1046 r1095  
    7474    if ($media_type == MEDIA_TYPE_VIDEO || $media_type == MEDIA_TYPE_TV ) // Movie 
    7575    { 
    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      } 
    9282      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      } 
    9890    } 
    9991    else 
    10092      $url = $server.'stream.php?'.current_session().'&tracklist='.$tracklist.'&media_type='.$media_type.'&idx='.$item_count.'&ext=.'.file_ext($row["FILENAME"]); 
    10193     
    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(); 
    105104 
    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    } 
    112107  } 
    113108 
  • trunk/swisscenter/images/style.ini

    r1046 r1095  
    4646;PAGE_TV                  = background.jpg 
    4747;PAGE_WEB                 = background.jpg 
    48 ;PAGE_DVD                 = background.jpg 
    4948 
    5049PAGE_BACKGROUND_COLOUR   = #000000 
     
    148147MENU_WEB_ALIGN           = center 
    149148MENU_WEB_WIDTH           = 650 
    150 MENU_DVD_ALIGN           = center 
    151 MENU_DVD_WIDTH           = 650 
    152149MENU_CONFIG_ALIGN        = center 
    153150MENU_CONFIG_WIDTH        = 650 
  • trunk/swisscenter/index.php

    r1060 r1095  
    1919    else 
    2020      return false; 
    21   } 
    22  
    23   /** 
    24    * Display the Video submenu 
    25    */ 
    26   function display_video_menu() 
    27   { 
    28     page_header( str('WATCH_MOVIE'),'','',1,false,'','PAGE_VIDEO'); 
    29  
    30     /** 
    31      * Menu Items 
    32      */ 
    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 content 
    50     */ 
    51     if ($menu->num_items() == 1) 
    52       header('Location: '.server_address().$menu->item_url(0)); 
    53     else 
    54       $menu->display(1, style_value("MENU_VIDEO_WIDTH"), style_value("MENU_VIDEO_ALIGN")); 
    55  
    56     page_footer('index.php'); 
    5721  } 
    5822 
     
    7943             && db_value("select 'YES' from media_locations where media_type=".MEDIA_TYPE_WEB." limit 1") == 'YES' ) 
    8044        || 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); 
    8246 
    8347    // Only display the RSS options if an internet connection is active, the user has enabled RSS support and has defined some subscriptions. 
     
    148112 
    149113    // 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); 
    152120 
    153121    // Only display the music options if the user has some music stored in the database. 
  • trunk/swisscenter/lang/en/en.xml

    r1084 r1095  
    23292329      <string> 
    23302330        <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.20.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> 
    23332333      </string> 
    23342334      <string> 
     
    24192419      <string> 
    24202420        <id>ORG_TITLE</id> 
    2421         <text>Edit Video/DVD Details</text> 
    2422         <version>1.20.1</version> 
     2421        <text>Edit Video Details</text> 
     2422        <version>1.21.1</version> 
    24232423      </string> 
    24242424      <string> 
  • trunk/swisscenter/media_dir_refresh.php

    r820 r1095  
    2323    $media_type      = $_REQUEST["media_type"]; 
    2424    $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 ); 
    2726    $media_locations = db_toarray("select * from media_locations where media_type=".$media_type); 
    2827   
    2928    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); 
    3130     
    3231    header('Location: '.$rtn); 
  • trunk/swisscenter/media_search.php

    r1063 r1095  
    4040      $types = media_exts( $location["MEDIA_TYPE"] ); 
    4141      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 ); 
    4343      send_to_log(4,'Completed refreshing '.strtoupper($table).' database'); 
    4444       
     
    8686     
    8787    // 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) ) 
    8989    { 
    9090      set_sys_pref('MEDIA_SCAN_STATUS',str('MEDIA_SCAN_STATUS_MOVIE')); 
  • trunk/swisscenter/video.php

    r1001 r1095  
    1616      search_hist_init( 'video.php', get_rating_filter().filter_get_predicate() ); 
    1717    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() ); 
    1919 
    2020    if ($cat_id <= 0) 
     
    2222    else 
    2323      $prev_page = "video.php?subcat=".db_value("select parent_id from categories where cat_id=$cat_id"); 
    24        
     24 
    2525    echo '<p>'; 
    2626 
     
    3030    if (get_sys_pref('browse_video_actor_enabled','YES') == 'YES') 
    3131      $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') 
    3333      $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') 
    3535      $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') 
    3737      $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') 
    3939      $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') 
    4141      $menu->add_item( str('BROWSE_FILESYSTEM')  ,"video_browse.php",true); 
    42        
     42 
    4343    if ($menu->num_items() == 1) 
    4444    { 
    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() ); 
    4646      header('Location: '.server_address().$menu->item_url(0)); 
    47     }  
     47    } 
    4848    else 
    4949    { 
    5050      $menu->display(1, style_value("MENU_VIDEO_WIDTH"), style_value("MENU_VIDEO_ALIGN")); 
    5151    } 
    52      
     52 
    5353    $buttons = array(); 
    5454    $buttons[] = array('text' => str('QUICK_PLAY'),'url'  => quick_play_link(MEDIA_TYPE_VIDEO,$_SESSION["history"][0]["sql"])); 
     
    6161      page_footer($prev_page, $buttons ); 
    6262  } 
    63    
     63 
    6464/************************************************************************************************** 
    6565   Main page output 
     
    6767 
    6868  page_header( str('WATCH_MOVIE') , '','',1,false,'',MEDIA_TYPE_VIDEO); 
    69    
     69 
    7070  if( category_count(MEDIA_TYPE_VIDEO)==1 || isset($_REQUEST["cat"]) ) 
    7171    display_video_menu($_REQUEST["cat"]); 
    7272  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); 
    7676 
    7777/************************************************************************************************** 
  • trunk/swisscenter/video_delete.php

    r1046 r1095  
    2424    case MEDIA_TYPE_TV    : $media_table = 'tv'    ; break; 
    2525    case MEDIA_TYPE_VIDEO : 
    26     case MEDIA_TYPE_DVD   : 
    2726    default               : $media_table = 'movies'; break; 
    2827  } 
  • trunk/swisscenter/video_selected.php

    r1074 r1095  
    8585                   'left outer join directors d on dom.director_id = d.director_id '. 
    8686                   '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 '
    8888  $select_fields = "file_id, dirname, filename, title, year, length"; 
    8989  $predicate     = search_process_passed_params(); 
     
    9999    $sql_table  .= 'left outer join genres_of_movie gom on media.file_id = gom.movie_id '. 
    100100                   '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 '
    102102  $file_ids      = db_col_to_list("select distinct media.file_id from $sql_table $predicate"); 
    103103  $playtime      = db_value("select sum(length) from movies where file_id in (".implode(',',$file_ids).")"); 
     
    115115  {     
    116116    // 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) 
    118118      page_error( str('DATABASE_ERROR')); 
    119119 
     
    123123      page_header( $data[0]["TITLE"] ); 
    124124 
     125    // Is DVD image? 
     126    $is_dvd = in_array(file_ext($data[0]["FILENAME"]), media_exts_dvd()); 
     127     
    125128    // 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   
    128143    // 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 )) 
    130145      $menu->add_item( str('RESUME_PLAYING') , resume_file(MEDIA_TYPE_VIDEO,$data[0]["FILE_ID"]), true); 
    131146         
    132147    // Add to your current playlist 
    133     if (pl_enabled()
     148    if (pl_enabled() && !$is_dvd
    134149      $menu->add_item( str('ADD_PLAYLIST') ,'add_playlist.php?sql='.rawurlencode("select distinct $select_fields from $sql_table $predicate order by title, filename"),true); 
    135150 
     
    141156    if ($data[0]["DETAILS_AVAILABLE"] == 'Y') 
    142157      $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 
    150168  // display the information that is common to all movies, and provide links to refine the search 
    151169  // further.