package ca.ksamad.encore.data

/** How the albums library is laid out: a compact [List] or a two-column [Grid] of cover art. */
enum class AlbumViewMode {
    List,
    Grid,
    ;

    companion object {
        /** Default when nothing is persisted yet. */
        val DEFAULT = List

        /** Parse a persisted name back to a mode, tolerating unknown/legacy values. */
        fun fromName(name: String?): AlbumViewMode = entries.find { it.name == name } ?: DEFAULT
    }
}
