fix jellyfin playlists, add is public

This commit is contained in:
Kendall Garner 2024-09-01 09:37:37 -07:00
parent 528bef01f0
commit 93377dcc4f
No known key found for this signature in database
GPG key ID: 18D2767419676C87
11 changed files with 81 additions and 51 deletions

View file

@ -607,9 +607,9 @@ const createPlaylist = async (args: CreatePlaylistArgs): Promise<CreatePlaylistR
const res = await jfApiClient(apiClientProps).createPlaylist({
body: {
IsPublic: body.public,
MediaType: 'Audio',
Name: body.name,
Overview: body.comment || '',
UserId: apiClientProps.server.userId,
},
});
@ -633,9 +633,9 @@ const updatePlaylist = async (args: UpdatePlaylistArgs): Promise<UpdatePlaylistR
const res = await jfApiClient(apiClientProps).updatePlaylist({
body: {
Genres: body.genres?.map((item) => ({ Id: item.id, Name: item.name })) || [],
IsPublic: body.public,
MediaType: 'Audio',
Name: body.name,
Overview: body.comment || '',
PremiereDate: null,
ProviderIds: {},
Tags: [],
@ -646,7 +646,7 @@ const updatePlaylist = async (args: UpdatePlaylistArgs): Promise<UpdatePlaylistR
},
});
if (res.status !== 200) {
if (res.status !== 204) {
throw new Error('Failed to update playlist');
}
@ -954,7 +954,12 @@ const getSongDetail = async (args: SongDetailArgs): Promise<SongDetailResponse>
return jfNormalize.song(res.body, apiClientProps.server, '');
};
const VERSION_INFO: VersionInfo = [['10.9.0', { [ServerFeature.LYRICS_SINGLE_STRUCTURED]: [1] }]];
const VERSION_INFO: VersionInfo = [
[
'10.9.0',
{ [ServerFeature.LYRICS_SINGLE_STRUCTURED]: [1], [ServerFeature.PUBLIC_PLAYLIST]: [1] },
],
];
const getServerInfo = async (args: ServerInfoArgs): Promise<ServerInfo> => {
const { apiClientProps } = args;