provide transcoding support

This commit is contained in:
Kendall Garner 2024-09-01 08:26:30 -07:00
parent da95a644c8
commit 528bef01f0
No known key found for this signature in database
GPG key ID: 18D2767419676C87
24 changed files with 347 additions and 69 deletions

View file

@ -28,6 +28,7 @@ import {
SimilarSongsArgs,
Song,
DownloadArgs,
TranscodingArgs,
} from '/@/renderer/api/types';
import { randomString } from '/@/renderer/utils';
import { ServerFeatures } from '/@/renderer/api/features-types';
@ -495,6 +496,19 @@ const getDownloadUrl = (args: DownloadArgs) => {
);
};
const getTranscodingUrl = (args: TranscodingArgs) => {
const { base, format, bitrate } = args.query;
let url = base;
if (format) {
url += `&format=${format}`;
}
if (bitrate !== undefined) {
url += `&maxBitRate=${bitrate}`;
}
return url;
};
export const ssController = {
authenticate,
createFavorite,
@ -506,6 +520,7 @@ export const ssController = {
getSimilarSongs,
getStructuredLyrics,
getTopSongList,
getTranscodingUrl,
removeFavorite,
scrobble,
search3,