Feature
A --watch flag for tuitube sync that runs as a background daemon, polling subscribed stations on a configurable interval and syncing new tracks automatically — no manual tuitube sync required.
Why
Right now, tuitube is a snapshot: you sync once and your library ages. For daily-driver use, users want new uploads from their lofi/jazz/ambient channels to appear automatically — like a podcast client or RSS reader. This is the feature that turns tuitube from a "tool I have to maintain" into a "service that just works."
UX
# Run in background, syncs every 6 hours
tuitube sync --watch --interval 6h
# Or managed by systemd/launchd
# tuitube provides a `tuitube install-service` command that writes the unit file
When new tracks are found:
- Write to DB as normal
- Optionally send a desktop notification via
notify-send (Linux) or osascript (macOS) — gated by a config flag
Implementation sketch
- Parse
--interval as time.Duration (default 6h)
- Run
SyncStations() immediately on start, then time.Sleep(interval) in a loop
- PID file at
~/.local/share/tuitube/sync.pid to prevent double-start
- Graceful shutdown on
SIGTERM/SIGINT
tuitube sync --stop to kill the daemon
tuitube install-service subcommand writes:
~/.config/systemd/user/tuitube-sync.service on Linux
~/Library/LaunchAgents/com.tuitube.sync.plist on macOS
Config integration (see #38)
[sync]
poll_interval = "6h"
notify_on_new_tracks = true
Files likely affected
cmd/sync.go — add --watch, --interval, --stop flags
- New
internal/daemon/daemon.go for PID management + signal handling
- New
cmd/installservice.go for the service file writer
Feature
A
--watchflag fortuitube syncthat runs as a background daemon, polling subscribed stations on a configurable interval and syncing new tracks automatically — no manualtuitube syncrequired.Why
Right now, tuitube is a snapshot: you sync once and your library ages. For daily-driver use, users want new uploads from their lofi/jazz/ambient channels to appear automatically — like a podcast client or RSS reader. This is the feature that turns tuitube from a "tool I have to maintain" into a "service that just works."
UX
When new tracks are found:
notify-send(Linux) orosascript(macOS) — gated by a config flagImplementation sketch
--intervalastime.Duration(default6h)SyncStations()immediately on start, thentime.Sleep(interval)in a loop~/.local/share/tuitube/sync.pidto prevent double-startSIGTERM/SIGINTtuitube sync --stopto kill the daemontuitube install-servicesubcommand writes:~/.config/systemd/user/tuitube-sync.serviceon Linux~/Library/LaunchAgents/com.tuitube.sync.pliston macOSConfig integration (see #38)
Files likely affected
cmd/sync.go— add--watch,--interval,--stopflagsinternal/daemon/daemon.gofor PID management + signal handlingcmd/installservice.gofor the service file writer