luminate/Sources/LuminateCore/Models/JellyfinMediaKind.swift

57 lines
2.3 KiB
Swift

//
// JellyfinMediaKind.swift
//
// Copyright 2026 Brendan Szymanski <hello@bscubed.dev>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
/// The kinds of Jellyfin library item Luminate understands.
///
/// Raw values are the wire spellings Jellyfin uses for `BaseItemKind`, so translating to and from
/// the generated API enums is a `rawValue` round trip. Luminate is scoped to movies and TV, so
/// music, book, photo, and live-TV kinds are deliberately absent; a server value with no case here
/// decodes as `nil` rather than failing the surrounding request.
package enum JellyfinMediaKind: String, CaseIterable, Hashable, Sendable {
/// A single feature-length film.
case movie = "Movie"
/// A television series, the parent of seasons.
case series = "Series"
/// One season of a series, the parent of episodes.
case season = "Season"
/// A single episode of a season.
case episode = "Episode"
/// A user-curated collection of items, called a box set by the server.
case boxSet = "BoxSet"
/// A top-level library folder such as "Movies" or "Shows".
case collectionFolder = "CollectionFolder"
/// A plain folder inside a library.
case folder = "Folder"
/// A view the server synthesises for a user, such as "Favorites".
case userView = "UserView"
/// A cast or crew member.
case person = "Person"
/// A production studio.
case studio = "Studio"
/// A genre used to group items.
case genre = "Genre"
/// An ordered, user-managed playlist.
case playlist = "Playlist"
/// A trailer attached to a movie or series.
case trailer = "Trailer"
/// A standalone video that is not a movie or an episode.
case video = "Video"
}