package com.ponzischeme89.memby.data

/**
 * How far one press of Left or Right moves the film.
 *
 * The vocabulary lives beside the settings it is stored in rather than in the player,
 * because three things read it — the store, the settings row and the player — and the
 * gateway's own catalogue (`seekIntervalSeconds` in `internal/api/preferences.go`) holds
 * the matching list. Keep the two in step: a value this build does not recognise is
 * normalised to the default rather than honoured, so an operator pushing an interval a
 * television has never heard of costs that set the default and never an unexplained skip.
 */

/** The intervals a viewer may choose between, in the order the settings row offers them. */
val SEEK_INTERVAL_SECONDS: List<Int> = listOf(10, 20, 30)

/** Ten seconds is the smallest offered, and the one a mis-press costs least to undo. */
const val DEFAULT_SEEK_INTERVAL_SECONDS: Int = 10

fun normalizeSeekIntervalSeconds(seconds: Int): Int =
    if (seconds in SEEK_INTERVAL_SECONDS) seconds else DEFAULT_SEEK_INTERVAL_SECONDS
