Create files named after folders (for offline media)
#1
I'm after a tool that can go through a few thousand folders, which are named "Movie Name (year)" and create an empty file within that folder, name exactly the same with a media extension (either avi or mkv).

I have seen other tools that do similar things like creating folders, or files that are dummy avi (which say insert disc etc), but cannot find one for this purpose.

The reason why if anyone is interested, not required reading:
I use 5*2TB drives for my media, and use a USB3.0 HDD dock for moving movies (1080p mkv) to offline 2TB drives, once watched or not expected to be re-watched right away. Otherwise my internal drives fill up quick.

I don't want these movies in my library, only a file view, so I have a non-library multi-path source "offline" that has both a docked drive (all drives have the same "offlinehdd" share name), and another folder ("offline" share name) of the nfo/fanart etc media (everything but the actual video file). What I do is move all the folders of the movies I want to take offline to the "offline" share, then copy them to the "offlinehdd" share of the docked drive, then just remove all the .mkv files from the "offine" share.

This keeps my library clean (just my favourite movies, and ones I have yet to watch - I didn't like having thousands in the library), but still lets me access a list of offline movies. Once I pop in the appropriate offline drive in the dock I can play the movie from the same play as it's a multi-path source.

This works all well and good as is, but in order to retain the offline movies in ember media manager (just to be able to see the media info for purposes of re-downloading a higher quality, or directors cut etc version), and to be able to do an "info" from the offline list, there needs to be a dummy video file in there.

Sorry for the long post. Perhaps my method can be criticized. It works well for me and takes almost no time and no additional tools.
Reply
#2
Most important. What is your OS? Oh wait, using Ember. Must be Windows.
Reply
#3
Mar2zz Wrote:Most important. What is your OS? Oh wait, using Ember. Must be Windows.

Whoops. Win 7 x64. XBMC Live on an Asrock ION3D box.
Reply
#4
This should do it for you. I created a folder named 'Top Level Folder' with some folders, the source to the script, and the compiled Exe. Just double click on the exe, and then check the folders newfolder1, etc and you will see that they now have the dummy files inside of them.

When you are comfortable, just put the .exe into your folder that holds your movie folders, and run it.

I know it's my second post here, but I am fairly well known in the emulation community. I just mention it because for a second time poster to post code it sometimes triggers a red flag.

The code is simple, written in AutoHotKey.

Code:
#SingleInstance, Force
Loop, %A_ScriptDir%\*, 2
  FileAppend, , %A_LoopFileLongPath%\%A_LoopFileName%.avi
MsgBox, Done.
ExitApp

Be careful, and don't run it by mistake in the wrong place, it won't do any harm, but you will end up with dummy files in every folder.

Download File
Reply
#5
Tempest Wrote:This should do it for you. I created a folder named 'Top Level Folder' with some folders, the source to the script, and the compiled Exe. Just double click on the exe, and then check the folders newfolder1, etc and you will see that they now have the dummy files inside of them.

When you are comfortable, just put the .exe into your folder that holds your movie folders, and run it.

I know it's my second post here, but I am fairly well known in the emulation community. I just mention it because for a second time poster to post code it sometimes triggers a red flag.

The code is simple, written in AutoHotKey.

Code:
#SingleInstance, Force
Loop, %A_ScriptDir%\*, 2
  FileAppend, , %A_LoopFileLongPath%\%A_LoopFileName%.avi
MsgBox, Done.
ExitApp

Be careful, and don't run it by mistake in the wrong place, it won't do any harm, but you will end up with dummy files in every folder.

Perfect! Does exactly that (creates a zero byte .avi file within a folder with the same name as the folder, for all sub-folders under the directory it is executed from).

I can now see my offline media in both Ember and also do an info lookup from my xbmc "offline" file view. I thought it might be an issue that my folders are named "Moviename (year)" but the actual files are just "Moviename" but no worries.

I also like the fact the media resolution info is stored in the .nfo file, so I can use Ember to see if I need to obtain a better/newer version, without having to get the offline hdd out.

Cheers!
Reply

Logout Mark Read Team Forum Stats Members Help
Create files named after folders (for offline media)0