Making streaming DVD Setup easier...

Locked
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Re: Making streaming DVD Setup easier...

Post by Eugene »

Hi,

I think, features can be added in next version
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Re: Making streaming DVD Setup easier...

Post by Eugene »

JST200 wrote: I think this method could be coded, as all the data required to do this is available and the logic I mention above still works.
1. Settings - Processing - Add -
Name: Create DVD-Cell link
turn on "Button on the main form"
Script:

Code: Select all

var
  CellItem: TWmsScriptMediaItem;  
  sDVDTitle, sFilePath: string;
begin
  CellItem := WmsCurrentMediaListItem;  
  if (CellItem <> nil) and SameText(CellItem.Properties[mpiFilePath], 'DVDVIDEO.VOB') then begin
    sFilePath := CellItem.ItemParent.ItemParent.ItemParent.Properties[mpiFilePath];  //ifo-file
    sDVDTitle := ExtractFileName(ExtractFileDir(ExtractFileDir(sFilePath)));    
    WmsDatabaseAddLink(mfVideoCollectionsItemID, 'DVD\' + sDVDTitle, CellItem); 
    if FileExists(ExtractFilePath(sFilePath) + 'folder.jpg') then
      WmsFindMediaFolder(mfVideoCollectionsItemID, 'DVD\' + sDVDTitle).Properties[mpiThumbnail] := ExtractFilePath(sFilePath) + 'folder.jpg';
    WmsDatabaseAutoSave
  end
end.
Ok - Ok - Ok

2. Select "Cell 00 - 00:00:00 - ..." - click "Create DVD-Cell link"
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Re: Making streaming DVD Setup easier...

Post by Eugene »

JST200 wrote: I think I am going to have to learn Pascal (?).
:)
script_language.JPG
script_language.JPG (6.28 KiB) Viewed 8548 times
JST200 wrote: So, how difficult would it be to amend the script so that rather than getting sFilePath (?) from manually selecting the required Cell, it automatically finds it itself from the manually selected DVD Title. Something along the lines of (note: please forgive my meta-coding - its a long time since I wrote any real code!! And as I nmention above, I don't know Pascal! :-) )
Maybe it will be a solution for you, but not for others :)
dvd_sample.JPG
dvd_sample.JPG (33.87 KiB) Viewed 8548 times
A little later I'll add a script for your algorithm (processing for "All Movies").
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Re: Making streaming DVD Setup easier...

Post by Eugene »

JST200 wrote:That's "Basicscript" as in Visual Basic? Perhaps I might have chance after all - though Object Oriented code was something else I didn't get into! I'm going to need some examples! :D
http://www.wildmediaserver.com/forum/vi ... p?p=86#p86
JST200 wrote: In your DVD example, are you saying that there is no one Cell that is identifed as the full movie?
Yes, TV programs, serials, karaoke, ...
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Re: Making streaming DVD Setup easier...

Post by Eugene »

1. Settings - Processing - Add -
Name: Creating DVD-links
turn on "Button on the main form"
Script:

Code: Select all

procedure ProcessItem(aItem: TWmsScriptMediaItem);
var
  dtTimeLength, dtMaxTimeLength: TDateTime;
  i, j: Integer;                        
  CellItem, ChapterItem, MainCellItem, PartItem: TWmsScriptMediaItem;  
  sDVDPath, sDVDTitle: string; 
begin
  if aItem.IsFolder and SameText(ExtractFileExt(aItem.Properties[mpiFilePath]), '.ifo') then begin
    MainCellItem := nil; dtMaxTimeLength := 0;           
    for i := 0 to aItem.ChildCount - 1 do begin    
      PartItem := aItem.ChildItems[i];      
      if PartItem.IsFolder then                      
        for j := 0 to PartItem.ChildCount - 1 do begin        
          ChapterItem := PartItem.ChildItems[j];
          if ChapterItem.HasChildItems then begin          
            CellItem := ChapterItem.ChildItems[0];
            if SameText(CellItem.Properties[mpiFilePath], 'DVDVIDEO.VOB') then try            
              dtTimeLength := StrToTime(CellItem.Properties[mpiTimeLength]);              
              if dtTimeLength > dtMaxTimeLength then begin
                dtMaxTimeLength := dtTimeLength;
                MainCellItem := CellItem             
              end
            except end;            
          end          
        end
    end;
    if MainCellItem <> nil then begin    
      sDVDPath := ExtractFileDir(ExtractFileDir(aItem.Properties[mpiFilePath]));  
      sDVDTitle := ExtractFileName(sDVDPath);      
      WmsDatabaseAddLink(mfVideoCollectionsItemID, 'DVD\' + sDVDTitle, MainCellItem);
      if FileExists(sDVDPath + '\folder.jpg') then
        WmsFindMediaFolder(mfVideoCollectionsItemID, 'DVD\' + sDVDTitle).Properties[mpiThumbnail] := sDVDPath + '\folder.jpg';      
    end
  end  
end;

var
  AllMoviesFolder: TWmsScriptMediaItem;
  i: Integer;  
begin
  AllMoviesFolder := WmsFindMediaFolder(mfVideoAllMoviesItemID);
  if (AllMoviesFolder <> nil) and AllMoviesFolder.HasChildItems then begin
    WmsShowInformation('Creating DVD-links...');
    try 
      for i := 0 to AllMoviesFolder.ChildCount - 1 do     
        ProcessItem(AllMoviesFolder.ChildItems[i]);                
      WmsDatabaseAutoSave
    finally
      WmsHideInformation
    end      
  end
end.
Ok - Ok - Ok

2. Click "Creating DVD-links"
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Re: Making streaming DVD Setup easier...

Post by Eugene »

JST200 wrote: I have one further question (though it seems churlish of me to even ask!), although all the Collection DVD Titles now have an associated Icon, they don't show on the TV. Is this a limitation of DLNA?
Maybe limitation TV. Information about the thumbnails transferred and displayed on other DLNA-players.
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Re: Making streaming DVD Setup easier...

Post by Eugene »

JST200 wrote:Maybe/probably. Is there a way to check?
Select the folder "All movies" - right click - "Edit title" - click "Select thumbnail"
JST200 wrote: Cells show an "Icon" on the TV - although one doesn't appear for the cell in WMS when you select "Edit Info" for it.
Edit info - "Create thumbnail" (requests from a device, the mode Cards - automatic)

As far as I know, Sony TV show thumbnails for folders, but probably it depends on the model or mode of TV.
manuonline
Posts: 4
Joined: Sat Aug 13, 2011 6:40 pm

Re: Making streaming DVD Setup easier...

Post by manuonline »

WOW Great work!

Only one Question:

Can i Change the Language of Movie?

Thanks
Locked