KaraokeController
struct KaraokeController : APIRouteCollectionMethods for accessing the list of boardgames available in the onboard Games Library.
- 
                  
                  Required. Registers routes to the incoming router. DeclarationSwift func registerRoutes(_ app: Application) throws
- 
                  getKaraokeSongs(_:Asynchronous) GET /api/v3/karaokeReturns an array of karaoke songs in a structure designed to support pagination. Can be called while not logged in; if logged in favorite information is returned. This call can’t be used to browse the entire ~25000 song library. You must specify either a search string with >2 chars, or specify favorites=true. URL Query Parameters - ?search=STRING- Only show songs whose artist or title contains 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.
 DeclarationSwift func getKaraokeSongs(_ req: Request) async throws -> KaraokeSongResponseDataReturn Value
- 
                  getKaraokeSong(_:Asynchronous) GET /api/v3/karaoke/:song_idReturns a single karaoke song. Can be called while not logged in; if logged in favorite information is returned. DeclarationSwift func getKaraokeSong(_ req: Request) async throws -> KaraokeSongDataReturn Value
- 
                  getLatestPerformedSongs(_:Asynchronous) GET /api/v3/karaoke/performanceReturns an array of the 10 most recent karaoke songs that have been marked as being performed. Can be called while not logged in; if logged in favorite information is returned. Intent of this call is to let people see what’s been happening recently in the karaoke lounge without making a complete index of who sang what song whenavailable.DeclarationSwift func getLatestPerformedSongs(_ req: Request) async throws -> [KaraokePerformedSongsData]Return ValueAn array of up to 10 KaraokePerformedSongsData
- 
                  addFavorite(_:Asynchronous) POST /api/v3/karaoke/:songID/favoriteAdd the specified KaraokeSongto the user’s list of favorite songs. Must be logged inDeclarationSwift func addFavorite(_ req: Request) async throws -> HTTPStatusParameterssongIDin URL path Return Value201 Created on success. 
- 
                  removeFavorite(_:Asynchronous) POST /api/v3/karaoke/:songID/favorite/removeDELETE /api/v3/karaoke/:songID/favoriteRemove the specified KaraokeSongfrom the user’s favorite list.DeclarationSwift func removeFavorite(_ req: Request) async throws -> HTTPStatusParameterssongIDin URL path Return Value204 No Content on success. 200 OK if song was already not favorited. 
- 
                  userCanLogKaraokeSongPerformances(_:Asynchronous) GET /api/v3/karaoke/userismanagerReturns TRUE in isAuthorized if the user is a Karaoke Manager, meaning they can create entries in the Karaoke Song Log. DeclarationSwift func userCanLogKaraokeSongPerformances(_ req: Request) async throws -> UserAuthorizedToCreateKaraokeLogsReturn Value200 OK 
- 
                  logSongPerformance(_:Asynchronous) POST /api/v3/karaoke/:songID/logperformanceAllows authorized users to create log entries for karaoke performances. Each log entry is timestamped, references a song in the Karaoke song catalog, and has a freeform text field for entering the song performer(s). Song performers don’t need to be Twit-arr users and may not have accounts, but @mentions in the note field should be processed. DeclarationSwift func logSongPerformance(_ req: Request) async throws -> HTTPStatusParameterssongIDin URL path noteNoteCreateDatain request bodyReturn Value201 Created on success. 
- 
                  reloadKaraokeData(_:Asynchronous) POST /api/v3/karaoke/reloadReloads the karaoke data from the seed file. Removes all previous entries. Throws A 5xx response should be reported as a likely bug, please and thank you.DeclarationSwift func reloadKaraokeData(_ req: Request) async throws -> HTTPStatusReturn ValueHTTP 200 OKif the settings were updated.
 View on GitHub
            View on GitHub
           KaraokeController Structure Reference
      KaraokeController Structure Reference