mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-12 07:12:58 +02:00
refactor api controller to internalize server fetch
This commit is contained in:
@@ -11,7 +11,7 @@ import { authenticationFailure } from '/@/renderer/api/utils';
|
||||
import { useAuthStore } from '/@/renderer/store';
|
||||
import { jfType } from '/@/shared/api/jellyfin/jellyfin-types';
|
||||
import { getClientType } from '/@/shared/api/utils';
|
||||
import { ServerListItem } from '/@/shared/types/domain-types';
|
||||
import { ServerListItemWithCredential } from '/@/shared/types/domain-types';
|
||||
|
||||
const c = initContract();
|
||||
|
||||
@@ -359,7 +359,7 @@ export const createAuthHeader = (): string => {
|
||||
};
|
||||
|
||||
export const jfApiClient = (args: {
|
||||
server: null | ServerListItem;
|
||||
server: null | ServerListItemWithCredential;
|
||||
signal?: AbortSignal;
|
||||
url?: string;
|
||||
}) => {
|
||||
|
||||
@@ -9,8 +9,8 @@ import { getFeatures, hasFeature, VersionInfo } from '/@/shared/api/utils';
|
||||
import {
|
||||
albumArtistListSortMap,
|
||||
albumListSortMap,
|
||||
ControllerEndpoint,
|
||||
genreListSortMap,
|
||||
InternalControllerEndpoint,
|
||||
LibraryItem,
|
||||
Played,
|
||||
playlistListSortMap,
|
||||
@@ -40,7 +40,7 @@ const VERSION_INFO: VersionInfo = [
|
||||
['10.0.0', { [ServerFeature.TAGS]: [1] }],
|
||||
];
|
||||
|
||||
export const JellyfinController: ControllerEndpoint = {
|
||||
export const JellyfinController: InternalControllerEndpoint = {
|
||||
addToPlaylist: async (args) => {
|
||||
const { apiClientProps, body, query } = args;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user