XBMC Library With advancedsettings.xml
I’ve had a modified XBOX for some time now, and let me tell you – it is the best single device I’ve ever owned. I hardly ever play games on it anymore, I only stream video from my 1.5TB file server.
I’m something of a movie buff. I collect DVDs and have amassed a collection of around 400, and even that represents a small portion of films I’ve actually seen. But what I’ve been especially into over the last year or two is TV shows. I honestly believe that television is a far superior medium for the simple reason that the story does not need to unfold in a sandbox only 2-3 hours long. Masterpieces like Carnivale or Lost are testaments to that. But the problem I found with the TV DVD sets is they lend themselves to being watched in large clusters, like mini-marathons. And not that I’m especially lazy, but I got tired of swapping out the discs. Or more accurately, I came to realize that I had the technology at my fingertips to never again need to swap discs, and so I decided to apply it.
Many of my projects start that way: I have the resources and the motivation, the reasons themselves are irrelevant.
It actually started with Carnivale, which I put on my PC (before I purchased my server) and served up from there via SMB, in other words just basic windows file sharing. Problem eventually came to be that I or someone else would be watching a movie at the same time as working on the computer which in the course of my fiddling, might need to reboot. This, of course, would interrupt the stream rather rudely.
And so I bought my beloved server. But that’s not the point here.
I downloaded a number of TV shows, some from the UK that aren’t even available over here, but most from this side of the Atlantic to avoid having to transcode all the video myself. I had organized the files by a folder named for the show, then a subfolder for each season. And ultimately this came to be a bit unwieldy, so I eliminated the subfolders and had a flat hierarchy.
Then I discovered something I had long ignored. XBMC (the program all my streaming was based on) had a function to identify a “library”. Now the library mode itself I don’t care for, but it’s not necessary that I like it, as the function I love isn’t exclusive to the library mode.
The mode I’m talking about is illustrated in the picture below:
Now at first I could not achieve this. All downloaded files had an “scene friendly” naming convention, which was usually something along the lines of The_Show_3x01… or The_Show_S03E01… and I had renamed them to conform to my own standard.
Say I want to watch yet another great episode of Lost. I go into my Lost folder, and all of the files start with “Lost”. I didn’t see that it was necessary as I had just entered the Lost folder so It should be obvious. So my naming standard became something like 101 – Pilot.avi. Sweet and simple. The problem with this is the media library parser didn’t know how to interpret this non-default standard, thus couldn’t apply the banners or individual episode screenshots or synopses. And after only a few hours of thorough research and a quick tutorial of Regular Expressions, I had a solution.
XBMC is such a great program that it allows some very unique customizations for those who know what they are doing. One such modification is made in an “advancedsettings.xml” file, which I am including below for anyone else who has the same naming convention, however it also supports the default naming conventions I noted earlier. To apply it, simply place it in your XBMC/userdata directory – this will work for XBMC no matter what it is installed on.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <advancedsettings> <tvshowmatching> <regexp>([0-9]+)([0-9][0-9])[^\\/]*</regexp> <regexp>([0-9]+)x([0-9]+)[^\\/]*</regexp> <regexp>s([0-9]+)e([0-9]+)[^\\/]*</regexp> </tvshowmatching> </advancedsettings>
What the file does here is direct the library parser to look at the parent folder for the name of the TV show, but retains the ability to find the name and episode in the file itself. So now it will accept various possibilities like:
The Show/101 – Pilot.avi
The Show/S1E01 – Pilot.avi
The Show/The.Show.1×01.Pilot
And more!
I’ve found the advancedsettings.xml file to be quite versatile with what it will detect.
Update: I recently discovered my advancedsettings.xml file was breaking what the XBMC developers fixed. The tvshowmatching tag I was using is no longer necessary as per my post here.
