Adam Bandel


Personal Media Feed

Jul 2026
Type: web-app
Code: 63k lines
Files: 302
Active: Apr 2025 to Jul 2026
Stack:
PythonFastAPIReactTypeScriptSQLiteChromaDBTailwindCSSGenerative GatewayDocker
Tags:
aidataautomationdeveloper-tools

Overview

Personal Media Feed (PMF) keeps videos, articles, podcasts, books, TV shows, movies, games, music, manga and comics in one library. Items are the single things to watch, read or play; collections are the channels, feeds, podcasts, shows, authors and artists they belong to.

Given a link or a title, PMF works out what the thing is and fetches its details from public metadata services such as TMDB, IGDB, Open Library, AniList, MangaDex, iTunes and PodcastIndex, picking the ones that fit the content type. An LLM then reads each item and adds a summary, keywords, moods, sentiment and named entities, and ChromaDB holds an embedding of each one, so the library can be searched by meaning as well as by words.

It runs on my home server, and every model call goes through my Generative Gateway. A copy of its database from July 2026 held 915 items and 2,846 collection entries, such as a channel’s videos or a show’s episodes.

PMF also has saved filter views (Smart Views), content classes that keep some kinds of items out of the main feed, and a Sonarr and Radarr integration that checks whether a show or movie is already there and adds it if not. Collections are checked for new entries on a schedule, weekly by default, unless I switch monitoring off for one. A New Releases page lists the newest entries across all collections, and each one can be added to the library, marked as consumed or ignored. A chat panel answers questions using the saved items, and a graph view links items by embedding similarity and shared tags.

Screenshots

Feed View

Collection Detail

Bulk Import

Problem

Media is spread across YouTube, Spotify, Goodreads, Steam, Crunchyroll and dozens of other platforms, each with its own interface, recommendations and tracking. None of them gives one view of what to watch, read or play next based on everything you’ve already tracked.

The tools that pull some of it together either cover one medium, like Plex for video or Calibre for books, or need everything entered by hand. I wanted something I could give a URL to that would work out what it is, fetch its details, and file it alongside everything else I’m tracking.

Approach

The backend is split into modules by domain and talks to a React frontend over REST and Server-Sent Events.

Adding things

Bulk add takes one link or title per line. Rules that can be edited in Settings recognize links from YouTube, IMDb, Spotify, Goodreads, AniList, Steam, GitHub and Reddit. A line can also carry a label like “Movie: Interstellar (2014)” or a hint like “(show)”, and text after a pipe can add context for the LLM or say who recommended the item. A plain title is searched on TMDB and Open Library and the candidates are ranked by title similarity and popularity; untyped titles also go to the LLM for a guess at what kind of thing they are. By default each line goes straight in with its top candidate, and a preview mode shows what every line will become, with duplicates flagged, before anything is saved.

Enrichment

Each new item is enriched by a background task. YouTube videos use the YouTube Data API for the title, description and tags, plus the transcript when one exists. Web pages go through trafilatura, and PDFs through pypdf. The model fills a fixed JSON schema: summary, keywords, moods, sentiment, complexity, named entities, estimated length, and facets such as platform, genre and release year. The prompts are editable in Settings. After that the item gets an embedding and a duplicate check, and its status goes to the browser over Server-Sent Events.

Stack

Challenges

Outcomes

Since 19 July 2026 PMF has run on my home server instead of Docker Desktop on my PC. A deploy script copies the code to the server and rebuilds the containers, and leaves the server’s database, vector index and secrets alone. On the PC, the backend reached Sonarr and Radarr through a Tailscale sidecar container that acted as its HTTP proxy. On the server they are on the same local network, so the sidecar is switched off and the backend connects to them directly.

Model calls have gone through the Generative Gateway since January 2026.

On first start the app creates a set of default saved views, such as Videos, Articles, Documentaries and Consumed.

Limits

Implementation Notes

Rate Limits

The collection resolver keeps one token bucket per service, sized in requests per second:

LIMITERS = {
    "tmdb": TokenBucket(rate=40.0, capacity=40.0),
    "tvmaze": TokenBucket(rate=20.0, capacity=20.0),
    # ...
    "musicbrainz": TokenBucket(rate=1.0, capacity=1.0),
    # ...
    "podcastindex": TokenBucket(rate=1.0, capacity=1.0),
    # ...
}

Collection Population

A YouTube channel’s videos are paged through its uploads playlist, whose ID is the channel ID with the UC prefix swapped for UU. A page of a playlist costs 1 unit of YouTube API quota, where a search costs 100. Channels, podcasts and feeds fill up to 500 entries when they’re added, and an admin action fetches more, up to 1,000.

# The uploads playlist ID is the channel ID with 'UC' replaced by 'UU'
uploads_playlist_id = None
if channel_id.startswith('UC'):
    uploads_playlist_id = 'UU' + channel_id[2:]

SSE Enrichment Updates

Each open browser connection gets its own asyncio queue on the SSE endpoint. Enrichment and collection tasks broadcast item_update and collection_update events into every queue, and a ping every 15 seconds keeps the connection open:

async def broadcast_update(self, event_data: Dict[str, Any]):
    """Puts an event message onto all active connection queues."""
    # ...
    # Put the event data onto each queue concurrently
    tasks = [queue.put(event_data) for queue in self.connections]
    await asyncio.gather(*tasks) # Wait for all puts to complete

Related Posts

No posts yet.