Sam Saffron

I am going to try to post a little bit about my adventures refactoring Media Browser. In this post I am covering a some aspects of entity resolution.

Media browser has a bunch Entities that it deals with, for example: Movies, Episodes and Shows. We scan the file system and figure out what files and folders map to what entities.

This is done using entity resolution.

I have defined a new set of classes that take in a location and spit out a factory that knows how to create an entity. Sounds a bit tricky, but this trickiness gives us tons of flexibility. The beauty of this system is that code now lives in a very logical place. If a user is trying to figure out why a particular file is not being detected as a Movie we know to look at the MovieResolver which contains all the logic for movie resolution. Additionally, this architecture is very plug-in friendly and incredibly testable.

For example, I just fixed up a bug where folders were not being detected as movies properly.