Semantic Webbiness, some authentication, and a whole lot of ACLs

Menu

Something Way Less Dry: TV Shows

After my rather boring blog about change notifications I will now to write about something that I wanted every since I started developing Nepomuk. But only now has Nepomuk reached a point where it provides all the necessary pieces. I am talking about TV Show management – obviously I mean the rips from the DVD boxes I own.

So what about it? Well, I wrote a little tool called nepomuktvnamer (inspired by the great python tool tvnamer) which works a bit like our nepomukindexer except that it does not extract meta-data from the file but tries to fetch information about TV Shows from thetvdb.com. You can run the tool on a single file or recursively on a whole directory. It will then use a set of regular expressions (based on the ones from tvnamer) to analyze the file names and extract the show title, season and episode numbers.

The nepomuktvnamer will ask the user in case multiple matches have been found and cannot be filtered according to season and episode numbers

It will then save that information into Nepomuk through our powerful Data Management API. The code looks a bit as follows ignoring code to store actors, banners and the like.

(This code uses my very own LibTvdb which is essentially a Qt’ish wrapper around the thetvdb.org API.)

The result of this can be seen in Dolphin:

Here we see the actors, the series, the synopsis and so on. Clicking on an actor will bring up all they played in, clicking on the series will bring up all the episodes from that series, and so on.

Now let us have a look at the series itself using my beefed up version of the Nepomuk KIO slave:

As we can see the nepomuktvnamer also fetched a banner which is stored as nie:depiction. (A reason why to compile nepomuktvnamer you need the git master version of shared-desktop-ontologies. Oh, and also nepomuktvnamer is linked against libnepomukcore from nepomuk-core instead of libnepomuk. So you either have to install nepomuk-core which cab be a bit tricky or quickly change the CMakeLists.txt to link to libnepomuk instead.)

We can of course also query the newly created information. Simple queries in Dolphin could be “series:Sherlock” or “sherlock season=1″. Well, things to play with.

I also created the smallest Nepomuk service to date: the nepomuktvnamerservice uses the ResourceWatcher to listen for newly created nfo:Video resources and simply calls the nepomuktvnamer on the related file.

Last but not least the git repository contains a python script which checks for each existing series if a new episode has been aired. The output looks a bit like this:

White Collar - New episode "Withdrawal" (02x01) first aired 13 July 2010.
Freaks and Geeks - No new episode found.
The Mentalist - Upcoming episode "Red is the New Black" (04x13) will air 02 February 2012.

Now obviously this is more a task for a Plasma applet. So if anyone out there is interested in doing that – please go ahead. I think it could be a cool thing. One basically only has to update whenever a new nmm:TVShow is created or when the new day dawns.

33 thoughts on “Something Way Less Dry: TV Shows”

For even more fun, you could try to map the IDs of things from TheTVDB to TvTropes/DbTropes (http://dbtropes.org) – and you enable lots of weird searches, like show me all episodes that are “so bad it’s horrible” or an “evil genius” character.

Bangarang actually already does quite some of the described things and isn’t only usable to display these information.
– Extract series name, season and episode from filenames
– Fetch additional information from TVDB (or other sources).

It looks like your approach is a little more advanced and more tightly integrated with DMS and the filewatch service, but I’m pretty sure Bangarang and Nepomuk could quite profit from each other to make this feature even more streamlined and seamlessly integrated into KDE.

Ohh this is the seamless desktop experience that crashed into my brain the day I became aware of nepomuk and started working on Bangarang. Looks like there a couple properties (synopsis, backlinks, etc.) to coordinate on but easy enough to fix!

That is awesome! First of all, finally gives a nice, practical explanation to those who don’t understand the point of this nepomuk service that’s always running. Second, it’s something I’ve been looking for myself. And, third, I hope this blog post gets publicized. It’d be great to have a plasmoid to search this and/or edit. And it’d be great to see it integrated into XMB or Plex or something.

The link redirects to nepomuk-tvnamer and last change is “Wed, 08 Jun 2011 16:07:21 +0000″ but there is other project nepomuktvnamer and last change is “Fri, 27 Jan 2012 16:15:29 +0000″ so I assumed that the right one is the second project.

But as you explain I can’t compile because I’m using official openSUSE KDE 4.8.0 packages.

Now compile and installs but LibTvdb git version is required too because project don’t compile with version 0.2.1.

This is a terrific use case to nepomuk and even I don’t need to do any changes to nepoogle, this is great!. So I added an entry to my nepomuk’s service menu and now I have a more comfortable method to add metadata to my media files than lauching Bangarang. I think that it’s a shame that Bangarang fetchers are not implemented externally like this one.

Without doubt this is the type of use for Nepomuk I imagined when I heard about it first when KDE 4.0 was released.

I’m having a problem building this; I’ve had the same problem before building Nepomuk based stuff…
tvnamer.h:34:36: fatal error: nepomuk/simpleresource.h: No such file or directory

Previously that was because I had an older KDE build, but I’m using Kubuntu (KDE 4.8, Ubuntu 11.10); I have /usr/include/nepomuk but no ‘simpleresource.h’.
I can see it in the KDE 4.6 API Reference at api.kde.org.

I have the same problem in ubuntu. The kdebase-runtime-dev package does not exist and the headers instaled with kdelibs correspond to the old “resource” api.
I tried to compile nepomuk-core but it seems to break things. Could you make a post on how nepomuk-core kdelibs/nepomuk and kde-runtime/nepomuk are suposed to interact together?

Ok, thanks for the confirmation Luis, I’m not (in this case) crazy or stupid.
Thanks, Sebastian, I’m guessing packaging bug if you expect the headers to be in the main KDE includes.

I have tried installing pretty much all of the kde-dev-xxx modules in Kubuntu, including some experimental stuff; none have the Nepomuk headers (although, I’m sure they were in there at some point around 4.6 transition – I can’t find the posts at kde.org I wrote at that time).

I’ll go and hassle the Kubuntu folks – they’re responsive if someone reports the problem (ie: it took a while but they finally put the right libstreamanalyzer into the distro and that made life much better!)

These headers were introduced in KDE 4.7 and were always a part of kde-runtime due to the freeze of kdelibs. They are also part of nepomuk-core but installing that along-side kdelibs is a bit ugly at the moment.

This ended up being bounced back to KDE as a bug:Bug 293662 – nepomuk library unversioned but headers are shipped

it was requested that we ship the nepomuk headers that are installed by
kde-runtime. The reason we don’t do that currently is that we can’t guarantee a
stable ABI for the package. While libnepomukcommon.so doesn’t seem to have any
public headers, libnepomukdatamanagement.so does but without a properly
versioned SONAME.
While we have no versioned library we’re not going to ship the headers as we
need that for the ABI checks.