README file from
GithubStardust Importer
An Obsidian plugin that pulls watched movies (Trakt) and full-album listens (Last.fm) into notes in your vault, rendered through your own Movie/Album Templater templates. Named for Ziggy Stardust — the guise of Media, the New God of the screen.
What it does
- Movies — on launch (after a delay), fetches new entries from Trakt's
/users/me/history/movies(movies only — TV never leaks in) and createsMovies - <title>notes. Re-watches updatelast:+rewatched: trueinstead of duplicating. - Albums — reconstructs full-album listens from Last.fm scrobbles using a session detector: a sitting counts as an album listen when one album dominates a gap-bounded session and ≥ a coverage threshold of its tracklist was played. Creates
Albums - <title>notes. Re-listens setrelistened_14d: true.
How notes are created
The plugin doesn't reproduce the note schema — it hands data to the existing templates via a filename-keyed handshake. Each template's top <%* %> block reads:
const __P = app.plugins.plugins["stardust-importer"]?.pending?.[tp.file.title];
If a payload is present it skips the interactive prompts and fills from it; otherwise the template behaves exactly as before for manual note creation.
- Movie template — payload
{ tmdbId, title, watchedAt }; reuses all TMDB enrichment, just skips the search/suggester/date prompts. - Album template — payload
{ artist, album, year, trackCount, listenedAt }; auto-selects the best MusicBrainz release-group (artist + title + closest year). On a low-confidence match it still attaches the best guess, setsneeds_review: true, and adds a warning callout (option b).
Setup
npm install && npm run build- Symlink into the vault:
.obsidian/plugins/stardust-importer→ this repo, enable the plugin. - In settings: add Trakt client ID/secret, Connect Trakt (device auth), add Last.fm API key + username.
- Backfill now (Trakt only) for movie history. Last.fm starts watching from first run forward — no history sweep.
Notes
- Uses Templater's internal
write_template_to_file— fine for a pinned personal install; a future Templater rewrite could rename it. - State (tokens,
lastScannedwatermarks, seen movies/albums) lives in this plugin'sdata.json.