Fix episodes are not updated after subtitle action

pull/1773/head
LASER-Yi 3 years ago
parent 967795e1a6
commit 1520d6614b
No known key found for this signature in database
GPG Key ID: BB28903D50A1D408

@ -12,8 +12,16 @@ export function useSubtitleAction() {
[QueryKeys.Subtitles], [QueryKeys.Subtitles],
(param: Param) => api.subtitles.modify(param.action, param.form), (param: Param) => api.subtitles.modify(param.action, param.form),
{ {
onSuccess: () => { onSuccess: (_, param) => {
client.invalidateQueries([QueryKeys.History]); 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]);
}
}, },
} }
); );

@ -4,7 +4,7 @@ declare namespace FormType {
profileid: (number | null)[]; profileid: (number | null)[];
} }
type SeriesAction = OneSerieAction | SearchWantedAction; type SeriesAction = OneSeriesAction | SearchWantedAction;
type MoviesAction = OneMovieAction | SearchWantedAction; type MoviesAction = OneMovieAction | SearchWantedAction;
@ -13,7 +13,7 @@ declare namespace FormType {
radarrid: number; radarrid: number;
} }
interface OneSerieAction { interface OneSeriesAction {
action: "search-missing" | "scan-disk"; action: "search-missing" | "scan-disk";
seriesid: number; seriesid: number;
} }

Loading…
Cancel
Save