↓ Skip to main content
  1. Posts/

Moments

Table of Contents

Old photo libraries on the big screen, without importing them anywhere or keeping the old drives plugged in.

Moments icon
tvOS 17+ • macOS 14+ Apple TV app + Mac server • personal project

Moments runs in our living room. It isn't distributed: the server is a Swift command-line tool, and the Apple TV app is signed with my own developer account.

Moments puts decades of family photos on the Apple TV. The photos live in old Aperture libraries on a stack of external hard drives, plus an Apple Photos library or two. Moments reads each library once, without changing it, and keeps TV-sized copies on a small home server. The drive goes back on the shelf, and the photos are a click away on the TV: by year and month, by album, by rating, or as a slideshow.

Highlights at a Glance
#

Aperture and Apple Photos

Reads Aperture 3 (.aplibrary) and Apple Photos (.photoslibrary) libraries directly, including projects, albums, ratings, places, captions and edits. Nothing is imported into Apple Photos.

Strictly Read-Only

Source libraries are only ever opened read-only. Apple Photos’ database is read from a private snapshot copy, so the live library is never locked or touched.

Plug In Once, Then Shelve

Each old drive is plugged in once. Moments writes compact HEIC copies for the TV and keeps them on the server, about a twelfth of the original size, and the noisy drive goes back on the shelf.

Made for the Living Room

A native SwiftUI Apple TV app: highlights, a timeline by year and month, Aperture’s folders and projects, favorites, On This Day, and a slideshow with an optional Ken Burns effect.

Over Tailscale

The server is reachable only on our tailnet, through tailscale serve, with real HTTPS and no port forwarding. The Apple TV finds it automatically over Bonjour.

Native, No Docker

One Swift binary with no third-party dependencies: SQLite, ImageIO for RAW decoding and HEIC encoding, Network.framework for HTTP, all from the system. It runs under launchd.

Why Moments?
#

Our photos from before Apple Photos are in Aperture libraries, spread over a stack of external drives. Aperture is long gone. Importing those libraries into Apple Photos would merge decades of old projects into the current library, and the alternative—a photo server in Docker—means keeping the drives plugged in and spinning.

What we actually wanted was simple: browse the old photos on the TV, the way Aperture organized them, with the drives back in the closet.


How It Works
#

1. Ingest
#

Plug in a drive and point moments ingest at a library. Moments reads the library’s database read-only and picks the right image for each photo: Aperture’s rendered preview for an edited photo, the original (RAW files included) for an unedited one, with the rotation applied either way. It writes a 2560-pixel HEIC copy for the TV and a small thumbnail for the grids, and records which drive each photo came from. Rejected photos are skipped unless you ask for them. Ingesting can be interrupted and resumed, and identical photos found in two libraries are stored once.

2. Merge
#

Libraries can be ingested on a faster Mac and merged into the server later with moments merge, since everything in the catalog uses relative paths and stable IDs.

3. Serve
#

moments serve runs on the home server under launchd and serves a small JSON API plus the transcoded images, which never change once written and can be cached on the TV for good. tailscale serve puts HTTPS in front of it. A browser preview is built in, too.

4. Watch
#

On the Apple TV, the app shows Highlights (5★ keepers, shuffle, On This Day, favorites), the Timeline, Aperture’s Projects, Favorites and Search. Photos play full-screen with the next ones pre-loaded, and the Siri Remote can mark a favorite. Favorites from Apple Photos and 5★ keepers from Aperture end up in the same stream.


Technology Stack
#

  • Language: Swift 6, one package for the server, the CLI and the shared API types
  • Server: Network.framework HTTP server, SQLite (system library), ImageIO / CoreGraphics for RAW decoding and HEIC encoding
  • Apple TV App: SwiftUI for tvOS
  • Networking: Tailscale (tailscale serve), Bonjour discovery
  • Targets: server on macOS 14+, app on tvOS 17+