I pop my head into this thread every once and a while. I've been living on v.2.1.5 for a while. As I mentioned in an earlier post, I love it but there was a definite need for a rescan feature. So, I tossed in a few lines of code to add another feature to the Right-click menu: "Auto Refresh Entries from Folder".
This is not as automatic as a watched folder or auto-refresh on startup, but it's a step in the right direction. Every once in a while, when I know I've made changes to my movies directory, I just select this option and it does a full rescan. It basically automates the steps of deleting the database and readding the folder.
I had to hard-code my folder as a constant in the code, though. It just takes a second at the beginning. So, as long as you have autohotkey installed, this may be of use.
Step #1: Added the following to the LISTVIEW RIGHTCLICK MENU (near the top of the script):
Code:
Menu("RightClickMenu","Add","Auto Refresh Entries from Folder `t (Beta)","KudosADDMoviesFromFolder"),
So... my entire LISTVIEW RIGHTCLICK FUNCTION reads as follows:
Code:
;________MAIN GUI - LISTVIEW RIGHTCLICK MENU___________|
GuiContextMenu:
IF (A_GuiControl = "$LIST") {
IF A_GuiControlEvent = RightClick
{
Menu("RightClickMenu","DeleteAll")
Menu("RightClickMenu","Add","Add New Entry `t Ctrl+A","ADDGUI"), Menu("RightClickMenu","Add","Auto Add Entries from Folder `t (Beta)","ADDMoviesFromFolder"), Menu("RightClickMenu","Add","Auto Refresh Entries from Folder `t (Beta)","KudosADDMoviesFromFolder"), Menu("RightClickMenu","Add")
Menu("RightClickMenu","Add","Copy to Clipboard `t Ctrl+C","CopytoClipboard")
$LNGT := LV_GetNext("C"), LV_GetText($MovieonMenu,$LNGT,1)
Menu("RightClickMenu","Add","? " $MovieonMenu " ? on IMDb","RightClickMenuHandler"), Menu("RightClickMenu","Add","Search ? " $MovieonMenu " ? on YouTube","RightClickMenuHandler")
Menu("RightClickMenu","Add","Search for Subtitles `t Ctrl+S","SUBGUI"), Menu("RightClickMenu","Add")
Menu("RightClickMenu","Add","Edit Entry `t Ctrl+E","EDITGUI"), Menu("RightClickMenu","Add","Delete Entry `t Ctrl+D","DELETEGUI")
Menu("RightClickMenu","Show",A_GuiX,A_GuiY), Menu("RightClickMenu","DeleteAll")
}
}
RETURN
Step #2: Function added to the end of the script (note that $KudosMVFolder is where I hardcoded my own movies folder):
Code:
KudosADDMoviesFromFolder:
; Variables
$KudosMVFolder = D:\Movies
; Delete list file
FileDelete % $MovieList
GuiControl %$MainGui%: Text, $MOVIESEARCH,
TrayTip % $ProgramName, % $MovieList A_Space "has been Deleted Successfully!",,1
SetTimer RemoveTrayTip, 3000
; Add entries from folder
IF $KudosMVFolder =
{
TrayTip % $ProgramName, No Valid Folder has been Selected!,,3
SetTimer RemoveTrayTip, 3000
}
$FolderList =
$Extensions = *.avi,*.wmv,*.mpg,*.divx,*.mov,*.mpeg,*.mp4,*.wmp
Loop Parse, $Extensions, `,
Loop %$KudosMVFolder%\%A_LoopField%, 0, 1
{
SplitPath A_LoopFileFullPath , , , , OutNameNoExt,
$FolderList = %$FolderList%%OutNameNoExt%;%A_LoopFileFullPath%;;;;`n
ToolTip % "Adding Movie > ? " A_Space A_LoopFileFullPatH " ?"
}
IFNotExist % $MovieList
FileAppend % $FolderList, % $MovieList
ELSE
FileAppend % "`n" . $FolderList, % $MovieList
ToolTip
Gui %$MainGui%: Default
GuiControl , , $MOVIESEARCH,
RETURN
Admittedly, this was a quick patch job, and is based on DELUSION's original functions (Thanks, by the way), but it saves a lot of headaches. Hope it can be of use to others.