diff --git a/src/components/lyricseditor/lyricseditor.js b/src/components/lyricseditor/lyricseditor.js index 3b69bc03d2..135f87980d 100644 --- a/src/components/lyricseditor/lyricseditor.js +++ b/src/components/lyricseditor/lyricseditor.js @@ -1,6 +1,6 @@ import escapeHtml from 'escape-html'; -import { LyricsApi } from '@jellyfin/sdk/lib/generated-client/api/lyrics-api'; +import { getLyricsApi } from '@jellyfin/sdk/lib/utils/api/lyrics-api'; import { toApi } from 'utils/jellyfin-apiclient/compat'; import dialogHelper from '../dialogHelper/dialogHelper'; import layoutManager from '../layoutManager'; @@ -27,7 +27,7 @@ let hasChanges; function downloadRemoteLyrics(context, id) { const api = toApi(ServerConnections.getApiClient(currentItem.ServerId)); - const lyricsApi = new LyricsApi(api.configuration, undefined, api.axiosInstance); + const lyricsApi = getLyricsApi(api); lyricsApi.downloadRemoteLyrics({ itemId: currentItem.Id, lyricId: id }).then(function () { @@ -128,7 +128,7 @@ function searchForLyrics(context) { loading.show(); const api = toApi(ServerConnections.getApiClient(currentItem.ServerId)); - const lyricsApi = new LyricsApi(api.configuration, undefined, api.axiosInstance); + const lyricsApi = getLyricsApi(api); lyricsApi.searchRemoteLyrics({ itemId: currentItem.Id }).then(function (results) { @@ -294,7 +294,7 @@ function onDeleteLyrics(e) { function fillCurrentLyrics(context, apiClient, item) { const api = toApi(apiClient); - const lyricsApi = new LyricsApi(api.configuration, undefined, api.axiosInstance); + const lyricsApi = getLyricsApi(api); lyricsApi.getLyrics({ itemId: item.Id }).then((response) => { diff --git a/src/components/lyricsuploader/lyricsuploader.js b/src/components/lyricsuploader/lyricsuploader.js index 9e21980348..817ccdda75 100644 --- a/src/components/lyricsuploader/lyricsuploader.js +++ b/src/components/lyricsuploader/lyricsuploader.js @@ -1,6 +1,6 @@ import escapeHtml from 'escape-html'; -import { LyricsApi } from '@jellyfin/sdk/lib/generated-client/api/lyrics-api'; +import { getLyricsApi } from '@jellyfin/sdk/lib/utils/api/lyrics-api'; import { toApi } from 'utils/jellyfin-apiclient/compat'; import dialogHelper from '../../components/dialogHelper/dialogHelper'; import ServerConnections from '../ServerConnections'; @@ -91,7 +91,7 @@ async function onSubmit(e) { const dlg = dom.parentWithClass(this, 'dialog'); const api = toApi(ServerConnections.getApiClient(currentServerId)); - const lyricsApi = new LyricsApi(api.configuration, undefined, api.axiosInstance); + const lyricsApi = getLyricsApi(api); const data = await readFileAsText(file); lyricsApi.uploadLyrics({