From a698b3cfe6690119c8fabf028f20983fada641dd Mon Sep 17 00:00:00 2001 From: "Mikal S." <7761729+revam@users.noreply.github.com> Date: Sun, 1 Sep 2024 20:07:01 +0200 Subject: [PATCH] More minor fixes (#1030) * fix: fix initial refresh for TMDB shows. * fix: moved connectivity check from settings to init. * fix: fix up fallback regex to be the same as the default regex again, except with an optional episode number. * misc: bump min server version --- src/core/react-query/settings/mutations.ts | 2 +- src/core/react-query/tmdb/mutations.ts | 7 +++++-- src/core/util.ts | 2 +- src/core/utilities/auto-match-regexes.ts | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/core/react-query/settings/mutations.ts b/src/core/react-query/settings/mutations.ts index ca5321607..c9da720dd 100644 --- a/src/core/react-query/settings/mutations.ts +++ b/src/core/react-query/settings/mutations.ts @@ -14,7 +14,7 @@ export const useAniDBTestLoginMutation = () => export const useCheckNetworkConnectivityMutation = () => useMutation({ - mutationFn: () => axios.post('Settings/Connectivity'), + mutationFn: () => axios.post('Init/Connectivity'), }); export const usePatchSettingsMutation = () => diff --git a/src/core/react-query/tmdb/mutations.ts b/src/core/react-query/tmdb/mutations.ts index 2dbcb18cb..832989f3c 100644 --- a/src/core/react-query/tmdb/mutations.ts +++ b/src/core/react-query/tmdb/mutations.ts @@ -11,8 +11,11 @@ import type { export const useTmdbRefreshMutation = (type: 'Show' | 'Movie') => useMutation({ - mutationFn: ({ tmdbId, ...data }: TmdbRefreshRequestType) => - axios.post(`Tmdb/${type}/${tmdbId}/Action/Refresh`, data), + mutationFn: ({ SkipIfExists = false, tmdbId, ...data }: TmdbRefreshRequestType) => + axios.post(`Tmdb/${type}/${tmdbId}/Action/Refresh`, { + ...data, + [type === 'Show' ? 'QuickRefresh' : 'SkipIfExists']: SkipIfExists, + }), }); export const useTmdbAddLinkMutation = (seriesId: number, type: 'Show' | 'Movie') => diff --git a/src/core/util.ts b/src/core/util.ts index 33544953c..12496c217 100644 --- a/src/core/util.ts +++ b/src/core/util.ts @@ -29,7 +29,7 @@ export function isDebug() { return DEV; } -export const minimumSupportedServerVersion = '4.2.2.104'; +export const minimumSupportedServerVersion = '4.2.2.110'; export const parseServerVersion = (version: string) => { const semverVersion = semver.coerce(version)?.raw; diff --git a/src/core/utilities/auto-match-regexes.ts b/src/core/utilities/auto-match-regexes.ts index 50ff10780..65bfa2882 100644 --- a/src/core/utilities/auto-match-regexes.ts +++ b/src/core/utilities/auto-match-regexes.ts @@ -252,7 +252,7 @@ try { name: 'fallback', regex: // eslint-disable-next-line no-useless-escape - /^(?:[{[(](?[^)}\]]+)[)}\]][\s_.]*)?(?(?gekijouban[\s_.]+)?(?:[a-z]+[\s_\.]+\d+(?=[\s_\.]*(?:-+[\s_\.]*)[a-z]+))?.+?(?[\s_\.]*(?:[-!+]+[\s_\.]*)?(?:the[\s_\.]+)?movie)?(?:[\s_\.]*\(part[\s_\.]*[ivx]+\))?(?:[\s_\.]*\((?(?:19|20)\d{2})\))?)(?[\s_\.]*(?:character[\s_\.]*)?(?:cm|pv|menu))?[\s_\.]*(?:-+[\s_\.]*)?(?:(?:(?(?sp(?:ecial)?)|(?ova)(?:[\s_\.]+(?:[_-]+[\s_\.]*)?e|(?=e))|s(?:eason)?(?\d+)(?:[\s_\.]+(?:[_-]+\.*)?e?|(?=e))|)(?:(?\d+(?:-+\d+|\.5)?|(?<=(?:ed|op)\s*)\d+\.\d+)?(?:[\s:\.]*end)?)(?:[\s:\.]*v(?\d{1,2}))?(?:[\s_\.]*-+(?:[\s_\.]+(?(?!\d)[^([{\n]*?))?)?(?:[\s_\.]+(?:[\s_\.]*-+)?)?(?:[\s_.]*(?:\([^)]*\)|\[[^\]]*\]|{[^}]*}|[([{]+[^)\]}\n]*[)\]}]+|(?:(?[a-zA-Z0-9_\-+]+)$/id, + /^(?:[{[(](?[^)}\]]+)[)}\]][\s_.]*)?(?(?gekijouban[\s_.]+)?(?:[a-z]+[\s_\.]+\d+(?=[\s_\.]*(?:-+[\s_\.]*)[a-z]+))?.+?(?[\s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