aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLASER-Yi <[email protected]>2022-03-19 02:33:51 +0800
committerLASER-Yi <[email protected]>2022-03-19 02:33:51 +0800
commit1520d6614b1b202cfaac579e3840c945db5e763d (patch)
tree77e4982e62540e2810cfe4802eaed58a99554016
parent967795e1a69a253a0743e16eaae9f90274075501 (diff)
downloadbazarr-1520d6614b1b202cfaac579e3840c945db5e763d.tar.gz
bazarr-1520d6614b1b202cfaac579e3840c945db5e763d.zip
Fix episodes are not updated after subtitle action
-rw-r--r--frontend/src/apis/hooks/subtitles.ts10
-rw-r--r--frontend/src/types/form.d.ts4
2 files changed, 11 insertions, 3 deletions
diff --git a/frontend/src/apis/hooks/subtitles.ts b/frontend/src/apis/hooks/subtitles.ts
index 5080daeb7..89626d8f9 100644
--- a/frontend/src/apis/hooks/subtitles.ts
+++ b/frontend/src/apis/hooks/subtitles.ts
@@ -12,8 +12,16 @@ export function useSubtitleAction() {
[QueryKeys.Subtitles],
(param: Param) => api.subtitles.modify(param.action, param.form),
{
- onSuccess: () => {
+ onSuccess: (_, param) => {
client.invalidateQueries([QueryKeys.History]);
+
+ // TODO: Query less
+ const { type, id } = param.form;
+ if (type === "episode") {
+ client.invalidateQueries([QueryKeys.Series, id]);
+ } else {
+ client.invalidateQueries([QueryKeys.Movies, id]);
+ }
},
}
);
diff --git a/frontend/src/types/form.d.ts b/frontend/src/types/form.d.ts
index aff28c170..99b16da88 100644
--- a/frontend/src/types/form.d.ts
+++ b/frontend/src/types/form.d.ts
@@ -4,7 +4,7 @@ declare namespace FormType {
profileid: (number | null)[];
}
- type SeriesAction = OneSerieAction | SearchWantedAction;
+ type SeriesAction = OneSeriesAction | SearchWantedAction;
type MoviesAction = OneMovieAction | SearchWantedAction;
@@ -13,7 +13,7 @@ declare namespace FormType {
radarrid: number;
}
- interface OneSerieAction {
+ interface OneSeriesAction {
action: "search-missing" | "scan-disk";
seriesid: number;
}