mirror of
https://github.com/d-fi/d-fi-core.git
synced 2025-07-19 19:54:51 +02:00
get channel list
This commit is contained in:
parent
32a3945f61
commit
f3e982c946
@ -221,7 +221,15 @@ if (process.env.CI) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test('GET CHANNEL LIST', async (t) => {
|
||||||
|
const channel = await api.getChannelList();
|
||||||
|
t.is(channel.count, channel.data.length);
|
||||||
|
t.true(Array.isArray(channel.data));
|
||||||
|
});
|
||||||
|
|
||||||
test('GET PLAYLIST CHANNEL', async (t) => {
|
test('GET PLAYLIST CHANNEL', async (t) => {
|
||||||
const channel = await api.getPlaylistChannel('dance');
|
const channel = await api.getPlaylistChannel('dance');
|
||||||
t.deepEqual(Object.keys(channel), ['version', 'page_id', 'ga', 'title', 'persistent', 'sections', 'expire']);
|
t.deepEqual(Object.keys(channel), ['version', 'page_id', 'ga', 'title', 'persistent', 'sections', 'expire']);
|
||||||
|
t.truthy(channel.title);
|
||||||
|
t.true(Array.isArray(channel.sections));
|
||||||
});
|
});
|
||||||
|
@ -8,6 +8,7 @@ import type {
|
|||||||
playlistInfo,
|
playlistInfo,
|
||||||
playlistTracksType,
|
playlistTracksType,
|
||||||
playlistChannelType,
|
playlistChannelType,
|
||||||
|
channelSearchType,
|
||||||
artistInfoType,
|
artistInfoType,
|
||||||
discographyType,
|
discographyType,
|
||||||
profileType,
|
profileType,
|
||||||
@ -130,6 +131,11 @@ export const getUser = async (): Promise<userType> => {
|
|||||||
throw new Error(errorMessage);
|
throw new Error(errorMessage);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get list of channles
|
||||||
|
*/
|
||||||
|
export const getChannelList = async (): Promise<channelSearchType> => request({}, 'search_getChannels');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get details about a playlist channel
|
* Get details about a playlist channel
|
||||||
*/
|
*/
|
||||||
|
@ -2,6 +2,7 @@ export * from './album';
|
|||||||
export * from './artist';
|
export * from './artist';
|
||||||
export * from './playlist';
|
export * from './playlist';
|
||||||
export * from './playlist-channel';
|
export * from './playlist-channel';
|
||||||
|
export * from './channel';
|
||||||
export * from './profile';
|
export * from './profile';
|
||||||
export * from './search';
|
export * from './search';
|
||||||
export * from './tracks';
|
export * from './tracks';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user