mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-24 03:16:43 +02:00
feat: add jukebox player engine for server-side playback (#2109)
* feat: add jukebox player engine for server-side playback --------- Co-authored-by: jeffvli <jeffvictorli@gmail.com>
This commit is contained in:
@@ -805,6 +805,53 @@ const reportPlaybackParameters = z.object({
|
||||
|
||||
const reportPlayback = z.null();
|
||||
|
||||
const jukeboxControlParameters = z.object({
|
||||
action: z.enum([
|
||||
'start',
|
||||
'stop',
|
||||
'skip',
|
||||
'set',
|
||||
'get',
|
||||
'setGain',
|
||||
'add',
|
||||
'clear',
|
||||
'remove',
|
||||
'shuffle',
|
||||
'status',
|
||||
]),
|
||||
gain: z.number().optional(),
|
||||
id: z.union([z.string(), z.array(z.string())]).optional(),
|
||||
index: z.number().optional(),
|
||||
offset: z.number().optional(),
|
||||
});
|
||||
|
||||
const jukeboxPlaylistEntry = z.object({
|
||||
album: z.string().optional(),
|
||||
artist: z.string().optional(),
|
||||
coverArt: z.string().optional(),
|
||||
duration: z.number().optional(),
|
||||
id: z.string(),
|
||||
isDir: z.boolean(),
|
||||
parent: z.string().optional(),
|
||||
title: z.string(),
|
||||
});
|
||||
|
||||
const jukeboxStatus = z.object({
|
||||
currentIndex: z.number().optional(),
|
||||
gain: z.number(),
|
||||
playing: z.boolean(),
|
||||
position: z.number().optional(),
|
||||
});
|
||||
|
||||
const jukeboxPlaylist = jukeboxStatus.extend({
|
||||
entry: z.array(jukeboxPlaylistEntry).optional(),
|
||||
});
|
||||
|
||||
const jukeboxControl = z.object({
|
||||
jukeboxPlaylist: jukeboxPlaylist.optional(),
|
||||
jukeboxStatus: jukeboxStatus.optional(),
|
||||
});
|
||||
|
||||
export const ssType = {
|
||||
_body: {
|
||||
getTranscodeDecision: transcodeDecisionRequestBody,
|
||||
@@ -834,6 +881,7 @@ export const ssType = {
|
||||
getStarred: getStarredParameters,
|
||||
getTranscodeDecision: transcodeDecisionParameters,
|
||||
getTranscodeStream: getTranscodeStreamParameters,
|
||||
jukeboxControl: jukeboxControlParameters,
|
||||
randomSongList: randomSongListParameters,
|
||||
removeFavorite: removeFavoriteParameters,
|
||||
reportPlayback: reportPlaybackParameters,
|
||||
@@ -882,6 +930,9 @@ export const ssType = {
|
||||
getStarred,
|
||||
getTranscodeDecision,
|
||||
internetRadioStation,
|
||||
jukeboxControl,
|
||||
jukeboxPlaylist,
|
||||
jukeboxStatus,
|
||||
musicFolderList,
|
||||
ping,
|
||||
playlist,
|
||||
|
||||
Reference in New Issue
Block a user