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

UserMessages.kt

package dev.stave.ui.copy

/**
 * User-facing copy for failures outside Browse (review 5, V3). Raw technical
 * strings ("libvlc reported an error", "LRCLIB returned HTTP 503",
 * "NullPointerException") belong in the log; the screen shows these instead.
 *
 * | Situation                         | Copy                                                     |
 * |-----------------------------------|----------------------------------------------------------|
 * | Track failed to play              | "Couldn't play ‘Title’."                                 |
 * | …and the player moved on          | "Couldn't play ‘Title’ — skipping to the next track."    |
 * | Party / random returned nothing   | "Your library didn't return any tracks to party with."   |
 * | Party / random failed             | "Couldn't pick random tracks right now. Try again in a moment." |
 * | Lyrics service HTTP / network     | "Lyrics service is unavailable right now." (+ Retry)     |
 * | Album notes found nothing         | "No album notes found for this album."                   |
 * | Anything else unexpected          | "Something went wrong. Try again in a moment."           |
 *
 * Browse failures have their own typed table (BrowseError, review 5 V3); keep
 * the two in the same voice: plain words, no protocol names, say what to try.
 */
object UserMessages {
    fun playbackFailed(title: String?): String =
        if (title.isNullOrBlank()) "Couldn't play this track." else "Couldn't play ‘$title’."

    fun playbackFailedSkipping(title: String?): String =
        if (title.isNullOrBlank()) "Couldn't play this track — skipping to the next one."
        else "Couldn't play ‘$title’ — skipping to the next track."

    const val PARTY_EMPTY = "Your library didn't return any tracks to party with."
    const val RANDOM_FAILED = "Couldn't pick random tracks right now. Try again in a moment."
    const val LYRICS_UNAVAILABLE = "Lyrics service is unavailable right now."
    const val ALBUM_NOTES_EMPTY = "No album notes found for this album."
    const val GENERIC = "Something went wrong. Try again in a moment."
}