Change where recordings show up - Recorded TV vs Movies
-
- Posts: 2623
- Joined: Wed Jun 08, 2011 3:15 am
- Location:
- HTPC Specs:
To be fair, it's not my program. I just happen to know how to use it.
-
- Posts: 111
- Joined: Fri Jun 10, 2011 9:59 am
- Location: Maarssen - the Netherlands
- HTPC Specs:
Ok, sorry, just missed that last partrichard1980 wrote:That registry edit does not accomplish the correct goal. Setting the value to 1 prevents movies recorded in WMC from appearing in the movie library. Setting it to 0 results in movies recorded in WMC will appear in the movie library, which is the default behavior anyway. Neither of the possible values accomplish the goal of having the movies only appear in the movie library but not appear in the recorded TV library, which is what this thread is discussing. The only way to accomplish that goal is to move the file out of the recorded TV folder and into a separate folder that is part of the movie library but is not part of the recorded TV library.
-
- Posts: 87
- Joined: Fri Jan 18, 2013 5:59 pm
- Location:
- HTPC Specs:
A huge thankyou for posting the solution to this. I finally got sick of dealing with a huge recorded TV list and have setup the tasks to move the movies as well at rename and move the TV episodes. Brilliant and thanks again!
-
- Posts: 79
- Joined: Sun Nov 02, 2014 6:24 pm
- Location:
- HTPC Specs:
I've started to use the 'MoveRecordedTvMovies' exe and it works like a treat. However, I can do without the '(YYYY)' on the end of the directory name. Is that an optional parameter that I can use? Or has someone got the source code that I can modify?
-
- Posts: 2623
- Joined: Wed Jun 08, 2011 3:15 am
- Location:
- HTPC Specs:
Code: Select all
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Toub.MediaCenter.Dvrms.Metadata;
namespace MoveRecordedTVMovies
{
class Program
{
static void Main(string[] args)
{
DirectoryInfo inDir, outDir;
List<FileInfo> files = new List<FileInfo>();
if (args.Length < 2)
{
Console.WriteLine("RecordedTvMovies <source folder> <target folder> [pause]");
Console.WriteLine("<source folder>:\nThe folder to find the .wtv and .dvr-ms files in (normally this will be your Recorded TV folder)\n");
Console.WriteLine("<target folder>:\nThe folder to create the individual movie folders in\n");
Console.WriteLine("[pause]: \nEnter without square brackets to cause execution to halt until you press a key on error");
Console.ReadKey();
return;
}
bool pauseOnError = (args.Length > 2) ? args[2] == "pause" : false;
try
{
inDir = new DirectoryInfo(args[0]);
outDir = new DirectoryInfo(args[1]);
files.AddRange(inDir.GetFiles("*.wtv"));
files.AddRange(inDir.GetFiles("*.dvr-ms"));
}
catch(Exception ex)
{
Console.WriteLine("Couldn't open folder: " + args[0]);
Console.WriteLine(ex);
if (pauseOnError) Console.ReadKey();
return;
}
Console.WriteLine("Found " + files.Count.ToString() + " .wtv and .dvr-ms files");
foreach(FileInfo fi in files)
{
try
{
using (DvrmsMetadataEditor ed = new Toub.MediaCenter.Dvrms.Metadata.DvrmsMetadataEditor(fi.FullName))
{
bool isMovie = GetMeta(ed, "WM/MediaIsMovie") == "True";
Console.WriteLine(isMovie.ToString() + ": " + GetMeta(ed, "Title") + " (" + GetMeta(ed, "WM/OriginalReleaseTime") + ")");
if (isMovie)
{
try
{
DirectoryInfo movieDir = outDir.CreateSubdirectory(MovieFolderName(ed));
fi.MoveTo(movieDir.FullName + "/" + fi.Name);
}
catch (Exception ex)
{
Console.WriteLine("Couldn't create folder and move movie: " + MovieFolderName(ed) + "/" + fi.Name);
Console.WriteLine(ex);
if(pauseOnError) Console.ReadKey();
}
}
}
}
catch (Exception ex)
{
Console.WriteLine("Couldn't access meta data for: " + fi.Name);
Console.WriteLine(ex);
if (pauseOnError) Console.ReadKey();
}
}
}
static string GetMeta(Toub.MediaCenter.Dvrms.Metadata.DvrmsMetadataEditor ed, string metaKey)
{
return DvrmsMetadataEditor.GetMetadataItemAsString(ed.GetAttributes(), metaKey);
}
static string MovieFolderName(DvrmsMetadataEditor ed)
{
string date = GetMeta(ed, "WM/OriginalReleaseTime");
int hyphen = date.IndexOf("-");
if (hyphen > 0) date = date.Substring(0, hyphen);
return GetMeta(ed, "Title").Replace(':', ';') + " (" + date + ")";
}
}
}
-
- Posts: 79
- Joined: Sun Nov 02, 2014 6:24 pm
- Location:
- HTPC Specs:
Excellent. Thankyou. I am pretty sure that I can mod this code to get it to do what I want.
However ... how do I get it compiled? I have visual studio 2005 installed on my PC ... but only the VB templates. I guess I could dig out the installation CDs and add C++ ... but is there an easier way? Or am I missing something here?
However ... how do I get it compiled? I have visual studio 2005 installed on my PC ... but only the VB templates. I guess I could dig out the installation CDs and add C++ ... but is there an easier way? Or am I missing something here?
-
- Posts: 2623
- Joined: Wed Jun 08, 2011 3:15 am
- Location:
- HTPC Specs:
That's C#, not C++. So you'll need to install C#, then just create a new command line project and drop the code above into it, add the appropriate references to the project, and compile. I assume you already have Toub.MediaCenter.Dvrms.dll, but if not I have attached it.
- Attachments
-
- New Compressed (zipped) Folder.zip
- (54.35 KiB) Downloaded 40 times
-
- Posts: 79
- Joined: Sun Nov 02, 2014 6:24 pm
- Location:
- HTPC Specs:
Thanks for the heads up. Looks like I will still have to find those VS2005 install disks. I'll leave that for the weekend.