SiteKaraokeController

struct SiteKaraokeController : SiteControllerUtils

Pages for displaying info on Karaoke Songs. This is all based on 2 kinds of data on the API:

  • KaraokeSongs, a static list of all ~25000 songs in the jukebox.
  • Performances. Authorized users can create log entries noting that one or more performers sang a KaraokeSong.
  • Declaration

    Swift

    func registerRoutes(_ app: Application) throws
  • karaokePageHandler(_:) Asynchronous

    GET /karaoke

    URL Query Parameters

    • ?search=STRING - returns song library results where the artist OR song title matches the given string. If a single letter or %23 is sent, it will return songs where the artist matches the letter, or starts with a number.
    • ?favorite=TRUE - Only return songs that have been favorited by current user.
    • ?start=INT - Offset from start of results set
    • ?limit=INT - the maximum number of songs to retrieve: 1-200, default is 50.

    With no search query, returns a page with a search form and a list of the 10 most recently performed songs. With a search parameter, returns a list of matching songs from the catalog. The underlying idea is that it’s not helpful to let the user browse all 25000+ songs.

    Declaration

    Swift

    func karaokePageHandler(_ req: Request) async throws -> View
  • addFavoriteSong(_:) Asynchronous

    Declaration

    Swift

    func addFavoriteSong(_ req: Request) async throws -> HTTPStatus
  • removeFavoriteSong(_:) Asynchronous

    Declaration

    Swift

    func removeFavoriteSong(_ req: Request) async throws -> HTTPStatus
  • Declaration

    Swift

    func songPerformanceLogEntryPageHandler(_ req: Request) async throws -> View
  • Declaration

    Swift

    func songPerformanceLogEntryPostHandler(_ req: Request) async throws -> HTTPStatus