mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-14 20:40:21 +02:00
provide transcoding support
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user