EARHORNMUSIC UPnP · Android TV · Phones · Android Auto · GNU/Linux
Release 0.5.0

MetadataHandoff.kt

19 lines · 733 bytes

Changed in: 0.5.0

1package dev.stave.ui.metadata
2
3import dev.stave.domain.model.DidlItem
4import javax.inject.Inject
5import javax.inject.Singleton
6
7/**
8 * Single-item "handoff" slot for MetadataScreen. A callsite sets [pending] with the target
9 * track just before navigating to the metadata destination; the destination's ViewModel
10 * reads it on first load and then clears it.
11 *
12 * Using this rather than passing the track through the navigation route because [DidlItem]
13 * isn't Parcelable and adding kotlin-parcelize for a single transient handoff isn't worth
14 * the build-config cost. Single-threaded TV app → no real risk of racing writers.
15 */
16@Singleton
17class MetadataHandoff @Inject constructor() {
18 var pending: DidlItem.Track? = null
19}