mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 10:23:33 +00:00
provide transcoding support
This commit is contained in:
parent
da95a644c8
commit
528bef01f0
24 changed files with 347 additions and 69 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue