mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 18:13:31 +00:00
[enhancement]: allow downloading individual tracks for external use
This commit is contained in:
parent
10fca2dc12
commit
c4677a63f6
10 changed files with 91 additions and 6 deletions
|
|
@ -27,6 +27,7 @@ import {
|
|||
StructuredLyric,
|
||||
SimilarSongsArgs,
|
||||
Song,
|
||||
DownloadArgs,
|
||||
} from '/@/renderer/api/types';
|
||||
import { randomString } from '/@/renderer/utils';
|
||||
import { ServerFeatures } from '/@/renderer/api/features-types';
|
||||
|
|
@ -482,10 +483,23 @@ const getSimilarSongs = async (args: SimilarSongsArgs): Promise<Song[]> => {
|
|||
}, []);
|
||||
};
|
||||
|
||||
const getDownloadUrl = (args: DownloadArgs) => {
|
||||
const { apiClientProps, query } = args;
|
||||
|
||||
return (
|
||||
`${apiClientProps.server?.url}/rest/download.view` +
|
||||
`?id=${query.id}` +
|
||||
`&${apiClientProps.server?.credential}` +
|
||||
'&v=1.13.0' +
|
||||
'&c=feishin'
|
||||
);
|
||||
};
|
||||
|
||||
export const ssController = {
|
||||
authenticate,
|
||||
createFavorite,
|
||||
getArtistInfo,
|
||||
getDownloadUrl,
|
||||
getMusicFolderList,
|
||||
getRandomSongList,
|
||||
getServerInfo,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue