Taking back TV control with Jellyfin

On this page

A book on a shelf lasts as long as the paper and the shelf do. A VHS tape lasts until the magnetic coating gives up, a DVD until the disc rots or the player dies. In every case the thing in your hand is the thing you watch, and nobody else gets a say in how long you keep it.

That stopped being true without much of a fight. Most of what we watch now is a licence to stream something from a server we do not control, on terms that can change. Films leave a service when a deal ends. Something you "bought" can vanish from your library. A page you linked to last year is gone, and nothing tells you whether it was moved, edited or quietly removed.

A week ago I set up Jellyfin on the mini PC in my office and pointed the living-room TV at it. This post is about why, and how.

Digital makes the past editable

In 2011 Hans Ulrich Obrist asked Julian Assange about his dreams for the future. Assange answered with Orwell's line about controlling the past, and said it had never been truer, because with digital archives control over the present allows "an absolutely untraceable removal of the past."1 A burned book leaves ashes and surviving copies. A changed web page leaves nothing, unless someone saved the old one.

You may have seen a punchier version making the rounds, about paper files being replaced so that one day you get "page not found" and the next day they deny it ever happened. I could not find that wording in anything Assange said or wrote, and I would rather not spread a quote nobody can source in a post about keeping the record straight. The interview above says the same thing, and it is real.

Who keeps the copies

Until 2024 you could open Google's cached copy of a page that had changed or gone down. Google retired cached links in February 2024, saying the feature had been built for an era when pages often failed to load.2 That September, Google Search started linking to the Internet Archive's Wayback Machine instead.3

So the copy of the web that matters now is kept by a non-profit. The Internet Archive's Wayback Machine holds billions of saved pages, and you can add to it yourself: paste any URL into Save Page Now and it is archived on the spot.4 Archive Team, a volunteer group, runs emergency grabs of sites that are about to shut down.5 And r/DataHoarder is where people who keep their own copies of things compare notes on drives, file systems and how not to lose it all.6

If this resonates, a few habits go a long way:

  • Save what you cite. When you link to something that matters, put it through Save Page Now first.

  • Keep your own copies of what is yours to keep. Your photos, your writing, your music, the discs on your shelf.

  • Back up properly. Three copies, on two kinds of storage, one of them somewhere else. A single drive is not an archive, it is a countdown.

  • Name things consistently. An archive you cannot search is a pile.

  • Share as widely as you ethically can. Public domain works, Creative Commons releases, your own work, and anything whose makers want it spread. Seed it, mirror it, upload it to the Internet Archive.

All of this within the law where you live. In the EU, whether you may make private copies of media you own is up to each member state: the Copyright Directive lets each country allow private, non-commercial copies by individuals, as long as rights holders get fair compensation, and the details differ from country to country.7 Look up your own before you rip anything.

One source that is easy to overlook: free-to-air broadcast TV. In most of Europe the terrestrial channels are broadcast unencrypted, and plenty of TVs and cheap set-top boxes can record them to a USB stick. Check that yours stores recordings as ordinary files and does not lock them to the device. People archive newscasts this way, and the news is exactly the kind of record that tends to get edited later.

My setup

Jellyfin is a free, open-source media server: it reads a folder of video files and serves them, with posters, metadata and resume points, to whatever screen you are watching on.8 No account with anyone, no telemetry, and it keeps working if the internet goes down.

The server is a Beelink SER6 Pro, a mini PC with a Ryzen 7 7735HS, running openSUSE Tumbleweed. Jellyfin runs in a rootless Podman container, managed by systemd as an ordinary user service. Podman calls this a Quadlet: you describe the container in a small file and systemd does the rest.9

# ~/.config/containers/systemd/jellyfin.container
[Unit]
Description=Jellyfin Media Server
After=network-online.target
Wants=network-online.target

[Container]
Image=docker.io/jellyfin/jellyfin:latest
ContainerName=jellyfin
Network=host
Volume=%h/jellyfin/config:/config:Z
Volume=%h/jellyfin/cache:/cache:Z
Volume=%h/Videos:/media:ro,z

[Service]
Restart=always

[Install]
WantedBy=default.target

systemctl --user daemon-reload turns that into jellyfin.service, and systemctl --user start jellyfin starts it. The media folder is mounted read-only, so the server can never damage the files. The :Z and :z suffixes matter on a distribution with SELinux enforcing: they relabel the folders so the container is allowed to read them. A file moved in later from somewhere else in your home folder keeps its old label, and Jellyfin silently will not see it until you relabel it with chcon -t container_file_t.

The library follows Jellyfin's naming conventions, which saves a lot of fixing metadata by hand:10

~/Videos/
  Movies/Title (Year)/Title (Year).mkv
  TV/Show Name (Year)/Season 01/Show Name S01E01 - Episode Title.mkv
  Documentaries/Title (Year)/Title (Year).mkv

What is in those folders is between me and my shelves.

The TV is an ordinary Android TV box running the Jellyfin app, pointed at the mini PC's address on the home network.11 I only use it at home, so nothing about it needs to be reachable from the internet.

A TV in the top bar

There was one annoyance left. The mini PC is in another room, and after I switch it on I would walk to the living room, open the app, and find the server still starting. So the desktop now tells me.

My window manager is SomeWM, and its top bar is written in Lua. I added a small TV icon to it. Every 15 seconds it asks systemd whether the Jellyfin service is running and asks Jellyfin's own health endpoint whether it is ready to serve. The icon is aqua when Jellyfin is healthy, orange while it is starting, and red when it is down. Clicking it opens Jellyfin; right-clicking restarts it.

-- Jellyfin: a TV in the bar that says whether the media server is up.
--   aqua: healthy   orange: starting or degraded   red: down
--   click: open Jellyfin   right-click: restart it
-- Only shown on a machine that runs Jellyfin as a user service (dotHQ).

local awful = require("awful")
local gears = require("gears")
local beautiful = require("beautiful")
local u = require("widgets.util")

local c = beautiful.colors
local URL = "http://127.0.0.1:8096"
local SERVICE = "jellyfin"

local icon = u.svg("tv", c.grey1)
local state = { status = "checking", detail = "" }

local function show(status, detail)
    state.status, state.detail = status, detail or ""
    local color = ({ healthy = c.aqua, starting = c.orange, degraded = c.orange, down = c.red })[status]
    icon:set_icon("tv", color or c.grey1)
end

-- systemd says whether the container is running; /health says whether Jellyfin
-- itself is ready to serve. Both together tell "starting" from "down".
local function refresh()
    awful.spawn.easy_async_with_shell(
        "systemctl --user is-active " .. SERVICE .. "; curl -fsS -m 3 " .. URL .. "/health",
        function(out)
            local unit, health = out:match("^(%S+)\n?(.*)$")
            health = (health or ""):gsub("%s+$", "")
            if health == "Healthy" then
                show("healthy")
            elseif unit == "active" or unit == "activating" then
                show(health ~= "" and "degraded" or "starting", health)
            else
                show("down", unit)
            end
        end)
end

local M = {}
M.widget = u.pill(icon, {
    left = 6, right = 6,
    buttons = {
        awful.button({}, 1, function() awful.spawn({ "xdg-open", URL }) end),
        awful.button({}, 3, function()
            show("starting")
            awful.spawn.easy_async({ "systemctl", "--user", "restart", SERVICE }, refresh)
        end),
    },
    tooltip = function()
        local text = ({
            healthy  = "Jellyfin is up",
            starting = "Jellyfin is starting…",
            degraded = "Jellyfin is up but reports: " .. state.detail,
            down     = "Jellyfin is down (" .. state.detail .. ")",
            checking = "Checking Jellyfin…",
        })[state.status]
        return text .. "\nClick: open · Right-click: restart"
    end,
})
M.widget.visible = false

-- Show the widget, and start polling, only where the service exists.
awful.spawn.easy_async({ "systemctl", "--user", "cat", SERVICE .. ".service" }, function(_, _, _, code)
    if code ~= 0 then return end
    M.widget.visible = true
    refresh()
    gears.timer { timeout = 15, autostart = true, callback = refresh }
end)

return M

That is the whole widget. It uses two small helpers from my config, u.svg for a recoloured icon and u.pill for the hover background, and a Lucide TV icon. It only appears on a machine that actually runs Jellyfin as a user service, so the laptop's bar stays as it was.

Now the evening goes like this: switch on the mini PC, wait for the little TV to turn aqua, walk to the living room, and put on Night of the Living Dead. Romero's 1968 original went out without a copyright notice and has been in the public domain ever since.12 If it is a lighter evening, Blender's open movies like Big Buck Bunny and Sintel are free to download and keep, under a Creative Commons licence.13

That is the point of all this. The film is on a drive in my house, and it will still be there next year.

Footnotes

  1. Hans Ulrich Obrist, In Conversation with Julian Assange, Part I (2011). ↩

  2. The Register, Google kills off cached webpages in search results, 5 February 2024. ↩

  3. Internet Archive Blog, New Feature Alert: Access Archived Webpages Directly Through Google Search, 11 September 2024. ↩

  4. Internet Archive, Save Page Now. ↩

  5. Archive Team. ↩

  6. r/DataHoarder. ↩

  7. Directive 2001/29/EC, Article 5(2)(b). Member states may, but do not have to, provide this exception. ↩

  8. Jellyfin. ↩

  9. Podman documentation, podman-systemd.unit (Quadlet). ↩

  10. Jellyfin documentation, Movies and Shows. ↩

  11. Jellyfin, Clients. ↩

  12. Night of the Living Dead, Wikipedia, on how the film entered the public domain. ↩

  13. Big Buck Bunny and Sintel, Wikipedia. ↩

dotmavriq.life

Scan to open the site on another device.