My latest hyperfixation has been organizing my media collection with Jellyfin, which is a fork of Emby, a Plex alternative which went closed-source around 2017.
Jellyfin is less popular than Plex, but has been gaining traction (especially as other media tools pick up support for it). I'm personally using it because it's written in C# and I wanted a system which I could hack on in the future.
Most of my collection consists of Blu-Ray rips, but I also have a few recordings of sportsball games (acquired legally, I assure you). These don't fit very cleanly into Jellyfin for a few reasons:
This is the big one. The auto-generated images for these are usually just random still images from some point in the game, which isn't super useful (and frequently are just the "Commercial Break" title screen). Being able to see the team logos would be nice, at a minimum. Navigating to events by team or home/away status would also be nice, similar to viewing media by studio, actor, genre, etc.
Additionally, part of the appeal of media library systems is that they pull this metadata from sources like TheTVDB automatically, based on filenames. This is currently impossible for sports in Jellyfin, unless you have a particularly good naming scheme and directory structure (which presents a very small extensibility surface for automation).
Movies are easy. TV shows are less easy, but can still be grouped into seasons. Sportsball events can too, but do you group them by team? By sport? How do you distinguish between multiple meetings of two teams in the same arena, other than by date? How do you group meetings within larger events, like how Formula One races also contain practices, qualifying sessions, sprint races, sprint qualifying sessions...
Jellyfin has quite a few plugins, both third-party and maintained by the core project, and a lot of extensibility points at which we can try to address some of these problems. I also have a surplus of free time, so I'm starting out on a metadata plugin which can pull images and other data from TheSportsDB, a free sport data provider.
I thought it would be interesting to document some of my work, and my thought process and strategy for getting from a throwaway shower thought to something that works.
The second point of this post is to talk about my usual development process, particularly the design phase. Similar to how I would build out a feature request in my professional life, I have a few initial goals:
- Create something that Jellyfin will load and display on the plugins page
- Make it F5-able (read: I can press "Debug" and hit breakpoints, without any faffing about and copying DLLs by hand
- Have a CI pipeline that can fail out if something gets pushed that only works on my machine
After cribbing quite a bit of code from the AniDB plugin which is conceptually similar to this one, the Git repo for this project has most of these things. I can click Debug in VS Code and hit a breakpoint in my plugin's constructor, the plugin shows up in Jellyfin itself, and there's a build workflow that uses most of the same CI infrastructure that the Jellyfin project maintains for plugin authors.
Admittedly, all of the paths for the VS Code stuff are specific to my laptop and the other Jellyfin repos I've cloned, but still.
The first actual pieces of functionality I want to implement:
- Add a "TheSportsDB Event ID" metadata identity that can store the corresponding event ID in the TheSportsDB API
- Add a "Sporting Event" library/media type to Jellyfin. Might be unnecessary or more appropriate for a separate plugin.
I also want to explore Jellyfin's abstractions to see what other improvements I could come up with.
Hopefully this is helpful to others! I'll keep writing as I go along, though I have a nasty habit of starting pet projects then discarding them a few months later. I suppose that's also something I can write about.