media, windows comments edit

Getting a DVD library going in Windows Media Server is not quite as straightforward as you might think. The information is out there on how to do it, but it’s spread far and wide as people writing it up assume you know a bunch of stuff you don’t know. Hopefully this will help get you started. [Note: For some context as to how my entire Media Server solution is set up and the goals I had in doing it, check out my overview.]

The goal here is to get your DVDs ripped into a digital format, stored somewhere a Windows Media Center PC can access them, be able to browse the list of available DVDs in a friendly format, and play the DVD as though you had placed the DVD into the tray - menus, extra features, the whole bit.

Note: It may be easier to do some of the things I’m about to describe if you don’t hold yourself to the “play it like it’s a full DVD” requirement - compressing the movie into an MP4 or something. I’m not going to cover that here because that process is more, “rip the movie, drop it in a folder, and you’re done.” I’m a quality freak and I want the whole kit-and-kaboodle, so that’s what I’ll cover. On the other hand, the only way to get things to work through a Media Center Extender (like an Xbox 360) is by compressing the movie. I’m not doing that, so my quality freak nature holds.

Note 2: I’m explaining this in Windows Vista terms, so paths and such will be Vista-oriented. There are similar settings you can use in Windows XP Media Center, but I haven’t actually tried them so I don’t want to provide advice on them.

Step 1: Determine where to store the ripped movies.

Windows Home
ServerA ripped DVD can take up to 8GB of space. For a sizable library, you’re looking at possibly a terabyte drive or larger. If you plan on only having one Windows Media Server, it can all be attached to that PC. If you might want to have more than one Windows Media Server, you’ll want to store the ripped DVDs on a file server on your network somewhere.

There are plenty of solutions for storing stuff on your network, from NAS solutions to dedicated file servers. I ended up getting a Windows Home Server and really like it. If you are able, I recommend it.

Step 2: Choose a format to rip your movies in.

For a full-disc rip, you have your choice of ripping the disc in ISO format or VIDEO_TS format. ISO format basically takes a full image of the disc, sector for sector, and stores that in one file. VIDEO_TS format just takes the files that are on the disc and puts those in a folder you specify. From a backup standpoint, ISO is going to produce a more literally accurate reproduction of the disc, but you can burn VIDEO_TS folders back to a DVD you can watch in a regular DVD player, too, so if you don’t mind losing things like, oh, the disc’s volume label, I’d go with VIDEO_TS for two reasons:

First, VIDEO_TS seems to be much more portable from an application playback standpoint. If you happen to have a Windows Media Center and a Mac running Front Row, for example, both can play back the same VIDEO_TS folder structure without issues. If it’s ISO, you generally need to configure some sort of ISO mounting tool on each front end to fool the system into thinking it’s a real DVD.

Second, VIDEO_TS rips seem to take much less space on disk. Space conservation, when you’re sometimes looking at one or two GB, is a good thing.

To that end, this step is sort of misleading. You’ll want to rip your movies in VIDEO_TS. But now you know why. (I’ve also posted a blog entry with some additional details about choosing a format. Much of this DVD Library setup guide won’t pertain to you if you choose a format other than VIDEO_TS, but if you want to look at different formats, here’s my comparison.)

Step 3: Rip your movies.

There are lots of different DVD ripping tools out there to choose from. I, personally, use the free DVDFab HD Decrypter, which comes as part of the commercial DVDFab product. (Make sure you get the “CSS Version” or you’ll not be able to rip CSS encrypted movies. The link I provided should get you there.)

DVDFab HD Decrypter - Full disc rip
settings

When you rip your movies, the organization is important. Movies should generally exist in a flat folder structure, and every folder name must correspond to the name of the movie it contains. This is probably easier to show in an example.

Say I have everything stored on a \\server\DVD share. When I explore \\server\DVD, I’ll see a hierarchy like this:

  • \\server\DVD
    • Movies
      • Aliens (1986)
        • AUDIO_TS
        • VIDEO_TS
      • Blade Runner (1982)
        • AUDIO_TS
        • VIDEO_TS
      • Die Hard (1988)
        • AUDIO_TS
        • VIDEO_TS
    • TV
      • Alias
        • Season 01
          • s01e01e02e03
            • AUDIO_TS
            • VIDEO_TS
          • s01e04e05e06e07
            • AUDIO_TS
            • VIDEO_TS

…and so on. Under that \\server\DVD share, I split things into Movies and TV.

Under the Movies folder, there’s one folder for each movie named with the movie title and year, and in each movie’s folder, you’ll see AUDIO_TS and VIDEO_TS folders - the results of the ripping process.

Under TV, there’s a folder for the TV series, then a folder for each season, and for each disc in the season there’s a folder that is named with the convention sXXeYYeYY that tells which season and which episodes are on each disc. In the example, you can see two discs in Alias season 1 - the first disc has season 1 episodes 1 through 3; the second disc has season 1 episodes 4 through 7.

UPDATE 12/29/11: This folder structure is slightly more detailed than my originally chosen structure due to my new adoption of XBMC as the front end. It doesn’t impact my use of Windows Media Center, though - it will work for both so it’s a good structure all around.

Using your ripper, rip the entire movie in VIDEO_TS format to the appropriate area on your network. It seems to be generally faster to rip to a local drive and copy the results of the rip over to the right location on the network than it is to rip directly to the network, but YMMV.

Two notes if you choose to use DVDFab HD Decrypter: First, it creates sort of an odd folder structure that actually seems to put the AUDIO_TS and VIDEO_TS folders down two or three levels from where you tell it to rip to. If you’re ripping local and copying to the network, just copy the stuff it rips and nests down in the folder structure - you don’t need to go all the way back up to the “FullDisc” folder it creates (you’ll know it when you see it). Second, DVDFab HD Decrypter gives you the option to rip non-movie-related files, like PC content (Flash executables, images, etc.) when you rip the movie. I do this, but you don’t have to. If you happen to see a “JACKET_P” folder that it rips as a peer to VIDEO_TS, that’s what that is. When you copy to the network, go ahead and copy all of the extra files it rips, too. It won’t hurt anything, it just won’t be used by Windows Media Center.

UPDATE 3/30/09: I created a script that fixes up the DVDFab HD Decrypter folder structure so you don’t have to fuss with the “FullDisc” folder anymore.

Step 4: Determine how you want to handle your metadata.

When you browse through your movies, you’ll probably want to see the cover image for the movie, the title, the year it was made, and other metadata about the movie. There are a lot of ways to get this to happen, and all of them require some sort of noodling around. This is, by far, the hardest step on the list because there are so many choices.

A lot of folks use, and enjoy, the My Movies plugin for Windows Media Center. It’s a very robust plugin that has a server component (which serves up the metadata and is where you manage your collection) and a client component (which gets installed on the Windows Media Center itself), and it may be that you have to install both on the same box if you only have the one Windows Media Center. It lets you navigate in all sorts of ways through your library - by genre, cast member, etc. It also has a very robust metadata engine that can either get data from a web service or import it from DVD Profiler, an amazing collection management tool (that I do use and recommend).

That said, My Movies is a plugin, and it does require a lot of fudging around, and I’m a big fan of just getting the out-of-the-box stuff to work for me with minimal hackery (less hackery == less that should break, though sometimes that’s incorrect). If you choose My Movies, more power to you - this is where this guide ends for you.

On the other hand, if you choose to use as much out-of-the-box Windows Media Center functionality, you’ll be looking at enabling the “DVD Library” functionality to read your ripped movies and display the metadata there.

So, again, this was sort of a trick step - we’re going with the built-in “DVD Library” in Windows Media Center.

UPDATE 9/24/08: There are some shortcomings with the built-in DVD player you might not like which I discovered after writing this guide and ripping a lot of movies. I’ve found that the quality is mediocre, and if you have a DVD that plays in “4 x 3 widescreen” (that is, it’s a 4 x 3 movie that has letterboxing such that you see a black box all the way around the movie), the built-in DVD player won’t let you “zoom in” or anything to clean that up. There is not, as far as I can tell, a way to integrate a different DVD player into the “DVD Library” feature. If you want a different DVD player, My Movies has good integration with the TheaterTek player and that seems to be a very common solution to the problem.

UPDATE 1/6/09: You can mess around with the aspect ratio and zoom options in the built-in DVD player by pushing the info “i” button on the remote or, I think, right-clicking on the video as it plays.

Step 5: Enable the DVD Library in Windows Media Center.

Out of the box, the “DVD Library” feature on Windows Media Center isn’t enabled. You’ll need to enable it with a registry setting. Per this Microsoft KB article (and my own experience), locate this registry subkey: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Media Center\Settings\DvdSettings …and find the ShowGallery key. Change the value of ShowGallery to be Gallery.

Once you’ve applied that, when you launch Windows Media Center you’ll see the “DVD Library” under “TV + Movies.”

The DVD Library appears under "TV + Movies" once it's
enabled.

Step 6: Configure Windows Media Center to find your ripped DVDs.

Now you need to tell Windows Media Center where your DVDs are ripped to.

  1. Open Windows Media Center.
  2. Go to Settings -> Library Setup.
  3. Select “Add folder to watch” and click Next.
  4. Here you can either select to “Add folders on this computer” (if you ripped your DVDs to the Windows Media Center PC) or “Add shared folders from another computer” (if you ripped your DVDs to a network location). Click Next.
  5. Select the place where you ripped your DVDs. You only need to select the top level folder (e.g., \\server\DVD) and you’re set.

There is a decent walkthrough of this when using a Windows Home Server over at We Got Served that has some screen shots.

Note: Some folks have found that after adding the folder to watch their movies don’t show up, even after restarting Media Center. If you’ve added your movie folder and it’s not finding your movies, try restarting Media Center. If it still doesn’t find your movies, you may have to add the folder through the DVD Library:

  1. Open Windows Media Center.
  2. Go to the DVD Library.
  3. Inside the DVD Library, right-click and select “Add Movies.” This will take you to a similar screen as the Library Setup (noted above) where you can add folders to watch that contain movies.

Step 7: Add the movie metadata.

Getting the metadata attached to your ripped movies is the last step in getting a nice DVD library going. Once you have metadata, navigating through your library and picking movies is simple, easy, and friendly for all members of the family.

Cover Image Only:

If you don’t care about anything but the cover image, it’s excruciatingly simple. Place a cover image for the movie inside the folder just above the VIDEO_TS folder and call the image folder.jpg. That’s it. Windows Media Center will use the name of the folder as the name of the movie and automatically use this image as the cover image and you’re done. It’d look like this:

  • \\server\DVD
    • Movies
      • Aliens (1986)
        • folder.jpg
        • AUDIO_TS
        • VIDEO_TS
      • Blade Runner (1982)
        • folder.jpg
        • AUDIO_TS
        • VIDEO_TS
      • Die Hard (1988)
        • folder.jpg
        • AUDIO_TS
        • VIDEO_TS

I actually want full metadata, though, so that’s not good enough for me.

Full Metadata:

The way Windows Media Center stores metadata is not necessarily straightforward, so it helps to undestand it before you make a choice on how to deal with this.

When you insert a real DVD, Windows Media Center reads an ID from the disc. This ID is a set of two eight-digit hex numbers, like “70464E8C-56B47572.” Windows Media Center uses this information to go online and retrieve information about the movie like cast information, the main movie length, and the cover image.

The information it retrieves gets stored in the C:\Users\USERNAME\AppData\Roaming\Microsoft\eHome\DvdInfoCache folder (where “USERNAME” is the name of the user running Media Center). For each disc loaded, you’ll see a corresponding XML file. Using the above example, you could look in that DvdInfoCache folder and you’d see a file called 70464E8C-56B47572.xml. The contents of that file look like this:

<?xml version="1.0"?>
<METADATA xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <MDR-DVD>
    <MetadataExpires>2008-12-10T18:49:18.5430057-08:00</MetadataExpires>
    <version>5.0</version>
    <dvdTitle>13 Going on 30</dvdTitle>
    <studio>Columbia TriStar</studio>
    <leadPerformer>Jennifer Garner; Mark Ruffalo; Judy Greer; Andy Serkis; Kathy Baker</leadPerformer>
    <director>Gary Winick</director>
    <MPAARating>PG13</MPAARating>
    <language />
    <releaseDate>2004 01 01</releaseDate>
    <genre>Romance</genre>
    <largeCoverParams>cov150/drt400/t455/t45554fmujx.jpg</largeCoverParams>
    <smallCoverParams>cov075/drt400/t455/t45554fmujx.jpg</smallCoverParams>
    <dataProvider>AMG</dataProvider>
    <duration>98</duration>
    <title>
      <titleNum>1</titleNum>
      <titleTitle>13 Going on 30 [Special Edition]</titleTitle>
      <studio>Columbia TriStar</studio>
      <director>Gary Winick</director>
      <leadPerformer>Jennifer Garner; Mark Ruffalo; Judy Greer; Andy Serkis; Kathy Baker</leadPerformer>
      <MPAARating>PG13</MPAARating>
      <genre>Romance</genre>
      <synopsis />
      <chapter>
        <chapterNum>1</chapterNum>
        <chapterTitle>Start</chapterTitle>
      </chapter>
      <chapter>
        <chapterNum>2</chapterNum>
        <chapterTitle>Thirteen</chapterTitle>
      </chapter>
      <!-- Add'l chapters elided for demo purposes -->
      <chapter>
        <chapterNum>28</chapterNum>
        <chapterTitle>Course Correction</chapterTitle>
      </chapter>
    </title>
  </MDR-DVD>
  <NeedsAttribution>true</NeedsAttribution>
  <DvdId>70464E8C|56B47572</DvdId>
</METADATA>

There’s a whole bunch of content in there - that’s the stuff that gets displayed on the screen, and that’s what you need to get into your ripped movies. You need to fool Windows Media Center into getting the proper DVD ID from each of your rips.

Fortunately, that’s actually easier than you think.

What you can do is place a tiny XML file in the folder that contains the VIDEO_TS folder. The name of the XML file is “MovieName.dvdid.xml” where “MovieName” is the name of the movie (which should also be the name of the folder containing the movie - it all needs to match). That looks like this:

  • \\server\DVD
    • Movies
      • Aliens (1986)
        • Aliens.dvdid.xml
        • AUDIO_TS
        • VIDEO_TS
      • Blade Runner (1982)
        • Blade_Runner.dvdid.xml
        • AUDIO_TS
        • VIDEO_TS
      • Die Hard (1988)
        • Die_Hard.dvdid.xml
        • AUDIO_TS
        • VIDEO_TS

Inside these tiny XML files are two lines - the name of the movie and the movie’s DVD ID. A sample looks like this:

<?xml version="1.0" encoding="utf-8"?>
<Disc>
  <Name>13 Going on 30 Special Edition</Name>
  <ID>70464E8C|56B47572</ID>
</Disc>

When Windows Media Center sees that, it thinks it’s a real DVD and it’ll go to its online service and automatically download all of the real metadata into the DvdInfoCache like I showed you earlier. The question is, how do you get those tiny “dvdid” files?

UPDATE 12/29/11: If you’re using DVDFab HD Decrypter to rip your discs, there’s an option in it to leave the dvdid file in the folder along with the rip so you don’t need to use the DVDXML web site.

If you already have the rip or otherwise need the file, though, what you need to do is go to the DVDXML web site and get a free account. The point of the DVDXML site is to provide you with these tiny “dvdid” files that you need to fool Windows Media Center into downloading the rest of the metadata for you. Sign up, sign in, and search to find the one that matches the DVD you ripped. It seems to be a pretty complete database.

What if the info isn’t on DVDXML? You have a couple of options. First, you could post to their forums and request it. Second, you could create it yourself, and there’s a tutorial on how to do it, but I can’t say I’ve done this yet so I don’t know how easy it is. That tutorial mentions that DVDFab 5 (the commercial version of DVDFab HD Decrypter) will make these for you, but I’ve not tried it. In general, the trick is going to be getting the DVD ID; it doesn’t seem that the “Name” element in that “dvdid” has to actually match anything. It’d probably be easy enough to do by hand if you can get the ID.

What if I’m not online or want to generate the full metadata myself? Seriously, it’s going to be far easier for you if you just let the system do the download work for you, but if your Windows Media Center isn’t connected to the network and you need to generate it all yourself, there seem to be a few options. Eric Charran has done it using a program called DVD Library Manager that uses Amazon and IMDb to get info. There’s another program called “MyDVDs” that is on a site that contains pre-generated complete versions of the data and will automatically download those for you (or you can manually download individual files). The idea is that you still get a “dvdid” file, but it generates the stuff in the DvdInfoCache for you, too, and omits the need for the system to look the data up. Again, the simplest route is to use DVDXML and put the “dvdid” file in your movie folder and let the system do the work for you.

What if I customize the metadata that gets downloaded? For example, you may change the title of the movie that gets displayed to be more accurate. If you do, there’s a bit of an interesting issue. The metadata comes with an expiration tag that has a date on which the item will be refreshed in the DvdInfoCache folder. If you change the metadata XML, your changes will be lost when the data gets refreshed. You can either manually edit the file in the DvdInfoCache to be a date really far in the future (so it never expires), you can remove the “MetadataExpires” element from the top, or you may actually want to generate the full metadata yourself. See above for more on that.

What do I recommend (so far)? I’m learning, so I’ll probably update this post and this recommendation as time goes on, but right now what I’m doing is:

  • Use DVDFab HD Decrypter and/or DVDXML to get the initial “dvdid” file. You’ll need that anyway.
  • Open Media Center and visit the DVD Library once to download the initial set of metadata. This does a quick, automated pre-population of most of the requisite fields.
  • Use DVD Library Manager to update any missing fields and/or modify the titles, etc. through Amazon and IMDb. Saving in DVD Library Manager will also remove the “MetadataExpires” attribute so you don’t have to fear any changes getting deleted.

 I’m also going to set up my DvdInfoCache so it’s stored on the server using a mapped drive via the Vista “mklink” command. That way any additional Media Center PCs I hook up will have all the same data.

I haven’t determined yet if I can/should leverage the DVD Profiler database that I already have going. There are nice high-res cover scans there that I’d like to take advantage of, and it’s a nicely formatted and consistent set of data to pull from.

 

This process is exactly what I’m doing to get my full DVD library ripped and accessible. So far it has pretty decent Wife Acceptance Factor, and I like having accessibility to my movies without having to do a lot of additional work. Hopefully this can help you to get your DVD library in order.

media, windows comments edit

HP MediaSmart
ServerIt was two weeks ago that I picked up my Windows Home Server and on the whole, I really do like it. Hanselman seems to like his, too, and his review helped a lot when I was getting things going. That said, there’s a lot I wish I had known as I was setting things up, so here’s a rundown of some of the things I’ve learned.

Initial Setup: There’s a lot more to setting it up than just plugging it in and turning it on. The setup guide that comes with the server runs you through some of that, but there’s definitely some “follow the on-screen instructions” detail-free action in that guide and it’s nice to know up-front what you’re looking at. I found a really nice online description of the initial setup steps for the server that you’ll want to check out.

Pre-Configured Shares: There are pre-configured folders for sharing Video, Music, and Pictures. If you go with the pre-configured defaults and just put the things you want to share into the respective folders, life will be easy for you. You can override these defaults and do your own thing, but there’s no real compelling reason to do that and it’ll just be difficult.

There are also pre-configured shares for software installation (like the recovery CD contents in case your backed-up computers take a dive; and Home Server add-ins) and each user that has an account on the machine. Again, if you just accept the defaults, your life will be easier.

**Media Sharing is Through Windows Media Connect: **The default media sharing is done through Windows Media Connect. For the most part, it works really well… unless your music is based in iTunes and you have a lot of, say, Apple Lossless format music like I do. WMC only supports a few formats and will filter out anything it can’t stream to a client (like your Apple Lossless music) so when you see the server appear on your Playstation 3 or Xbox 360 and only half your music is appearing, that’s why.

The WMC limitations also affect video formats, so if you’ve got your videos stored in the Videos folder and you’re not seeing them on your client, it’s probably a video format issue.

You can potentially overcome some of these issues by using the PVConnect add-in (see below) with the server, but I can’t really tell. A better solution is to run a real media server (like Windows Media Center) which can handle a more robust set of media formats.

PVConnect/TwonkyVision Add-In: The HP MediaSmart Server comes with an add-in called “PVConnect” that appears to have something to do with the TwonkyMedia “TwonkyVision” server. Honestly, I’m having a hell of a time finding any real detail on it. The only concrete thing I can find is that it will provide album art for your music (if the files have album art) and will “transcode” your photos so they display properly on whatever device is requesting them. Neither of these things are compelling enough for me to want to install an add-in without knowing what else is going on. It looks like there were some issues with it working with Playstation 3, but you can do a little manual hack to get around it.

I’d love for someone to tell me more about how this thing works and what it does. If it’ll enable Apple Lossless streaming, I’ll totally install it.

iTunes Library Sharing: The HP MediaSmart Server also comes with an “iTunes Library Sharing” facility that is comprised of two parts: a client part, that reads in your library/music info and copies it to the server; and a server part, that streams the aggregated contents of the “Music” folder over the network in iTunes format so you’ll see it in iTunes as a shared library.

If you already store your iTunes music in the “Music” folder (like if you’re following my multi-user iTunes instructions or if you’ve got iTunes generally set up to store your library on the network), you probably don’t want the client part running. The problem is, it’ll see your iTunes library and then try to copy that again into the shared “Music/iTunes” folder on the server. I’ve read a few horror stories about duplicate copies of songs ending up in the share and confusing things. The downside of not having the client portion running is that you won’t get your playlists to display in the shared library… but maybe that’s not a big deal. It’s not for me. The client portion of sharing is disabled by default.

iTunes sharing settings for the
client.

The server portion of the iTunes shared library service works just like standard iTunes library sharing - you can stream music from the shared library, you can listen to shared playlists, but you can’t add items from the shared library to your own playlists or sync the content to your iPod. It will automatically add anything in the shared “Music” folder into the shared library, even if the content wasn’t originally in iTunes. (“Adding it to the library” means it’ll add it to the list of things that can be streamed from this shared library. It doesn’t mean any files are getting moved around anywhere.) This is enabled by default on the server.

iTunes sharing settings on the
server.

Since my goal here was more just to store the music on a central server, not to have “shared library” content or whatever, I have both the client and server portions of the iTunes music sharing component disabled. If/when I do end up trying to get actual iTunes content with playlists and all streaming across the network, I’ll probably be looking at either just using a Mac Mini as my media center PC or using MCETunes to get Windows Media Center to recognize iTunes content. (I’ve blogged about MCETunes before.)

RAM Upgrade: A lot of folks online say you’ll see a huge performance gain by upgrading the 512MB RAM that comes with the MediaSmart server to 2GB. I, personally, haven’t run into any performance problems yet - it works peachy keen with the 512MB. That said, if I do run into issues, it looks pretty simple to do the upgrade, so I’ll probably look into it then.

Photo Organization is Important: The way Windows Media Connect shares photos, it actually exposes the folder structure you store your photos in. If you’ve not been organizing your photos too well, you’re going to see a mess when you try to browse from your Xbox or Playstation. I tend to organize by date, with top-level year folders and subfolders with the full date in YYYYMMDD and a description of the event being photographed - that way they sort, alphabetically, in date order. It looks like this:

  • 2004
  • 2005
  • 2006
  • 2007
    • 20070704 - Independence Day
    • 20071225 - Christmas
  • 2008
    • 20080704 - Independence Day
    • 20080723 - Trav’s Birthday
    • 20080908 - Screen Shots of Windows Home Server

This makes it very nice and easy to browse when you’re looking at it from a client.

Online Backup: I was backing up my computers using Mozy, but the Windows Home Server offers a full backup feature, too, so I’ve pretty much switched over to using that. Of course, I need to get the Windows Home Server backed up, so I started looking at options there.

Philip Churchill has a great writeup of various online backup solutions for Windows Home Server. I wanted to stick with Mozy, but they require you to get a Mozy Pro account to back up your Home Server, which costs $0.50/GB per month… and with 110GB of music alone, that’s $55/month to back up something I can back up for $50/year from my laptop. Disqualified. I also considered Carbonite but really wanted something that’s officially supported, and while they say it should work, they won’t support you backing up Windows Home Server. I’m also not interested in “tweaking things” to get it to work

  • one of the beauties of the WHS so far has been its “appliance-like” simplicity. I’m not eager to break that. Disqualified.

In the end, I picked KeepVault. It’s $100/year for unlimited storage and has a really nice Windows Home Server add-in so you can see your backup status and do restores right from the console. You tell it which shares you want to keep backed up and it does the rest. The only downside to this is it’s not backing up the OS or your computer backups… but since you can recover the OS reasonably easily, and the chances of my computers AND my WHS taking a dive at the same time are minimal, this is a perfect solution to me, and it seems other folks have had success with it, too. I’ll keep any really precious documents in my user share on the Home Server so they’ll not only be duplicated (for hardware failure fault tolerance) but also backed up by KeepVault. The rest will get backed up by the standard Windows Home Server computer backup facility. Done.

UPDATE 2/25/09: KeepVault has raised its prices to be far, far less affordable and there is no unlimited storage option. Once my current subscription expires, I will most likely switch over to use the built-in Windows Home Server option to backup to a USB drive and store the backups off-site myself. Ripping DVDs: One of my primary goals for getting the server was to store my VIDEO_TS rips of my DVDs so I can play them through some sort of media center. I’ve gotten this working - even over wireless, which was cool - through my primary laptop and Windows Media Center on Vista Ultimate.

It might sound obvious, but when you rip a DVD, rip it to your local drive first and then copy the files to the server. I found the ripping process was cut from like an hour and a half to about 20 min. when ripping it locally. Then you can start the copy over to the server while you’re ripping the next disc.

You will probably want to create a new shared folder on the server outside of the default “Videos” folder that it comes with. Since the server won’t stream VIDEO_TS or ISO anyway, you’re not losing out on functionality. That said, you probably don’t need file duplication turned on for your ripped movies or you’ll be chewing through space. Creating a separate “DVD” share to store your rips in will let you selectively turn off duplication for just the rips.

You’ll probably also not want to set your online backup solution to back up the rips. On both Mozy and KeepVault, it seems to take about a day to back up 7GB, and if you’ve got a lot of movies like I do, it’s going to take years to get the backup completed. Plus, if you ever do lose the data, it’ll be far faster to just re-rip the movie (or even go to the store and re-purchase it, if the disc has been destroyed, and re-rip) than it would be to get the content back from the online backup service. Save the online backup service for your photos, music, smaller videos, and documents.

Continued Work on My Home Media Solution: I’m still learning about the way to handle things - which program I like best for ripping DVDs, what the best way to add metadata to Windows Media Center for the ripped discs is, etc. - and I’ll post updates as I find them. I found one blog that explains almost an identical setup to what I’m trying to put together, so that’s been a lot of help. Right now the decision I’m trying to make is whether to go with Windows Media Center or whether to go with some sort of Mac solution, maybe using Front Row. I seem to be able to find information on WMC a lot easier, but maybe I’m just not looking in the right places. On the other hand, most of the Mac solutions seem to be appliance-like, just like the Home Server, and I’m a big fan of simple. We’ll see.

gists, net, testing, csharp comments edit

I’ve seen this question a few times in the Typemock forums so I figured I’d post a little something on it:

How do you mock a list using Typemock Isolator?

The challenge we currently have is that Isolator can’t mock types that are declared in mscorlib, which includes things like List<T>, so if you expose a list in your class, you have some potentially interesting mocking challenges, depending on how you choose to expose it.

If you wrap the list in methods/properties on your class, when you set up mocks, you’ll be setting up mocks against your class - not the list - so there is no problem there. If you expose the list as a public field, that’s where the challenge sets in.

Below is a code snippet showing an example class that does both things: it has a method and a property that “wrap” a list, and it has a public list field. Below that, you’ll see tests that illustrate different ways to handle the situations using Typemock Isolator.

public class ListExample
{
  // Publicly accessible list field
  public List<string> PublicList = new List<string>();

  // Private list that gets "wrapped" by methods/properties
  private List<string> _privateList = new List<string>();

  // Wraps the indexer of the private list
  public string this[int index]
  {
    get
    {
      return _privateList[index];
    }
    set
    {
      _privateList[index] = value;
    }
  }

  // Wraps the Add method on the private list
  public void Add(string value)
  {
    _privateList.Add(value);
  }
}

[TestFixture]
[VerifyMocks]
public class ListTestFixture
{
  // The problem we have is you can't mock types in mscorlib
  // so you need to either wrap the list or mock the field.

  [Test]
  public void WrappedList()
  {
    // If the list is "wrapped" in members of a type not
    // in mscorlib, we have it pretty easy because the
    // mocks get set up against the members on the ListExample
    // type, not against the List<T> object.

    ListExample example = new ListExample();
    using(RecordExpectations recorder = RecorderManager.StartRecording())
    {
      // No matter what index we ask for, we always want
      // the "expected" value to come back.
      string dummy = example[0];
      recorder.Return("expected");
      recorder.RepeatAlways();
    }

    // Put these values into the list...
    example.Add("a");
    example.Add("b");
    example.Add("c");

    // ...But what we get out is the mock value.
    // We can even ask for out of range indices.
    Assert.AreEqual("expected", example[0]);
    Assert.AreEqual("expected", example[1]);
    Assert.AreEqual("expected", example[2]);
    Assert.AreEqual("expected", example[3]);
    Assert.AreEqual("expected", example[4]);
  }

  [Test]
  public void FieldListMocks()
  {
    // Here the challenge is that there aren't any
    // members on the ListExample object that wrap
    // the list so we've actually got to "mock" the
    // list proper.

    // To accomplish the mock, we'll modify the object's
    // state by poking in our expected field value.
    ListExample example = new ListExample();
    ObjectState state = new ObjectState(example);
    List<string> expectedList = new List<string>();
    expectedList.Add("expected");
    state.SetField("PublicList", expectedList);

    // Now when we ask for the list, we're getting the
    // expected list, not the original member.
    Assert.AreEqual("expected", example.PublicList[0]);

    // When we're done, we can reset things back to the
    // original values, which means the real PublicList
    // will be back - and will still be empty.
    state.ResetState();
    Assert.IsEmpty(example.PublicList);
  }

  [Test]
  public void FieldListReflection()
  {
    // Of course, you can always do it the brute
    // force way, too, through reflection. It doesn't
    // look much different from the ObjectState version,
    // above, but we can't "return to the original
    // value" at the end of the test.
    ListExample example = new ListExample();
    List<string> expectedList = new List<string>();
    expectedList.Add("expected");

    typeof(ListExample)
      .GetField("PublicList",
        BindingFlags.GetField | BindingFlags.Instance | BindingFlags.Public)
      .SetValue(example, expectedList);

    // Now when we ask for the list, we're getting the
    // expected list, not the original member.
    Assert.AreEqual("expected", example.PublicList[0]);
  }
}

As you can see, testing with the list solely as a backing data store and exposing the values only through members on your own class is far easier and less… code-smelly… than exposing the list directly as a field. Generally speaking, you shouldn’t expose public or protected fields anyway, opting for property get/set instead to allow for more flexible implementations later should the need arise. That said, if you have something you’ve got to test using a public list field, above are some ways to do it.

net comments edit

The Typemock Insider blog mentions that Patterns & Practices has adopted Typemock Isolator as their mocking framework, at least for testing SharePoint applications. Blaine Wastell and Francis Cheung say they’re using it because it allows them to mock sealed and internal types, which SharePoint is full of.

I think this is cool and definitely says something: Even if you’re writing brand new code, which can be entirely designed for testability (if that’s what you want), at some point you’re going to have to interface with something you didn’t write (SharePoint, .NET Framework) and you’re still going to want to test that interface code, which is where Isolator comes in. I’m so glad they’ve got an open source license now!