Page 1 of 1

Using Hidden Video Indexes

Posted: 14 Jan 2017, 20:00
by ktbcrash
Hello,

I'm still hoping to get some help creating a custom column for this to be complete but I thought I would post all my buttons.

Leo helped me out and created a column script that will indicate if an index is missing or not :thumbsup: Thank you, good sir!


What these buttons allow you to do:

  • Index selected video(s)
  • Index all videos
  • Select all indexes
  • Hide all indexes
  • View hidden indexes
  • Play video from viewing index file
  • Play video from viewing index file and close Standalone Image Viewer
  • Select the corresponding video file from the currently viewed index


Demo
https://youtu.be/qasIJtCgwwA



Requirements:
- Dopus 12 (for the custom Standalone Image Viewer buttons)
- Some kind of video thumbnail indexer (I'll be using Video Thumbnail Maker and my buttons will reflect that. Adjust for your needs. NOTE: Using Video Thumbnail Maker, I found I needed to use the full path to the saved profile in order to work correctly)



Buttons for when you right-click on a video
Settings > File Types > File Type Groups > Movies (Context Menu)


View Thumbnail

Code: Select all

@nofilenamequoting
Show "{filepath$}.jpg" AUTOFILELIST



Index Videos... (Selected)(silent)

Code: Select all

@runmode:hide
"/dopusdata\Scripts\Video Thumbnails Maker\VideoThumbnailsMaker.exe" "C:\Users\USERNAME\AppData\Roaming\GPSoftware\Directory Opus\Scripts\Video Thumbnails Maker\Options\your_saved_preset.vtm" {allfile$} /silent




Buttons for when you right-click a lister background
Settings > Customize Toolbars > Context Menus > Lister Context


Index All Videos (silent)

Code: Select all

Select ALLFILES="grp:movies"
@runmode:hide
"/dopusdata\Scripts\Video Thumbnails Maker\VideoThumbnailsMaker.exe" "C:\Users\USERNAME\AppData\Roaming\GPSoftware\Directory Opus\Scripts\Video Thumbnails Maker\Options\your_saved_preset.vtm" {allfile$} /silent



Hide All Indexes

Code: Select all

Select NONE
Select ALLFILES="grp:Movies.jpg"
SetAttr ATTR h



Select All Indexes

Code: Select all

Select NONE
Select ALLFILES="grp:Movies.jpg"




Buttons for the Standalone Image Viewer (Dopus 12 required)


Play
adjust the path to your video player

Code: Select all

"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" {filepath$|noext}



Play & Close
adjust the path to your video player

Code: Select all

Select DESELECTNOMATCH SETFOCUS EXACT PATTERN={allfile|noext}
Show VIEWERCMD=close
"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" {filepath$|noext}



Select & Close

Code: Select all

Select DESELECTNOMATCH SETFOCUS EXACT PATTERN={allfile|noext}
Show VIEWERCMD=close

Re: Using Hidden Video Indexes

Posted: 23 Jan 2017, 22:16
by andersonnnunes
I started using VTM this week. It is a very nice program.

I made a script button to open the preview/index of a selected video file. It is a bit more complex than your "View Thumbnail" button. My script checks if there is a VTX file and opens it by default, otherwise it checks if there is a JPG file and opens it.

If you are interested, here is the Javascript code:

Code: Select all

// Generic Name: View Preview
// Type: Button
// Function: open file with preview thumbnails if it exist for the first selected movie file.
// License: CC0 Public Domain
// Creator: https://andersonnnunes.org/
// ------------------------------- Button Preferences
@disablenosel:files
// ------------------------------- Event
function OnClick(clickData)
{
   // Name of file type group for movies.
   // If you defined a personalized file type group for your movies, type it here.
   var localizedMovieGroupTypeName = "Movies";
   // --------------------
   // Determine verbosity level.
   // 1 - Print informative log.
   // 0 - Print nothing.
   var verbose = 0;
   // ------------------------------- Main
   DOpus.ClearOutput();
   // Check that there are files selected.
   if (clickData.func.sourcetab.selected_files.count == 0)
   {
      print("No files are selected.");
   }
   else
   {
      // Adjust command behavior.
      var cmd = clickData.func.command;
      cmd.deselect = false;
      cmd.SetQualifiers("none");
      cmd.ClearFiles;
      
      // Filter selected files to consider only movie files.
      for (var eSel = new Enumerator(clickData.func.sourcetab.selected_files); !eSel.atEnd(); eSel.moveNext())
      {
         var selectedItem = eSel.item();
         for(var i=0; i<selectedItem.groups.length; i++){
            if (selectedItem.groups(i).display_name == localizedMovieGroupTypeName)
            {
               cmd.AddFile(selectedItem);
            }
         }
      }

      // For each movie file, define what to do.
      for (var iSel = new Enumerator(cmd.files); !iSel.atEnd(); iSel.moveNext())
      {
         // Define paths.
         var cItem = iSel.item()
         var resPath = String(cItem.realpath);
         var extension = String(cItem.ext_m);
         var formats = new Array();
         var formatA = resPath + ".vtx";
         formats.push(formatA);
         var formatB = resPath.replace(extension, ".vtx");
         formats.push(formatB);
         var formatC = resPath.replace(extension, ".jpg");
         formats.push(formatC);
         var formatD = resPath + ".jpg";
         formats.push(formatD);

         // Find files.
         for (var i = 0; i < formats.length; i++)
         {
            if (DOpus.FSUtil.Exists(formats[i]))
            {
               if (i <= 1) {
                  var openPreviewCmdLine = "ContextMenu VERB=Open FILE=" + "\"" + formats[i] + "\"";
               } else {
                  var openPreviewCmdLine = "Show AUTOFILELIST " + "\"" + formats[i] + "\"";
               }
               cmd.AddLine(openPreviewCmdLine);
               // Execute commands.
               cmd.Run;
               return;
            }
         }
      }
   }

   // Print only if requested.
   function print(text){
      if (verbose) {
         DOpus.Output(text);
      }
   }
}