Merge pull request #8427 from Shadowghost/fix-stale-plugins

This commit is contained in:
Bill Thornton authored and GitHub committed 2026-09-07 12:30:27 -04:00
commit 691a76052d
2 files changed
+5 -6

No files matched your search

@@ -8,17 +8,16 @@ import { useApi } from 'hooks/useApi';
import { QueryKey } from './queryKey';
import { queryClient } from 'utils/query/queryClient';
import type { PackageInfo } from '@jellyfin/sdk/lib/generated-client/models/package-info';
import { getPackagesQuery } from './usePackages';
const fetchPackageInfo = async (
api: Api,
params: PluginApiGetPackageInfoRequest,
options?: AxiosRequestConfig
) => {
const packagesData = queryClient.getQueryData([ QueryKey.Packages ]) as PackageInfo[];
if (packagesData && params.assemblyGuid) {
// Use cached query to avoid re-fetching
const pkg = packagesData.find(v => v.guid === params.assemblyGuid);
if (params.assemblyGuid) {
const packages = await queryClient.fetchQuery(getPackagesQuery(api));
const pkg = packages.find(v => v.guid === params.assemblyGuid);
if (pkg) {
return pkg;
@@ -16,7 +16,7 @@ const fetchPackages = async (
return response.data;
};
const getPackagesQuery = (
export const getPackagesQuery = (
api?: Api
) => queryOptions({
queryKey: [ QueryKey.Packages ],