|
|
@ -40,13 +40,17 @@ export function createDefaultReducer(): SocketIO.Reducer[] {
|
|
|
|
update: (ids) => {
|
|
|
|
update: (ids) => {
|
|
|
|
LOG("info", "Invalidating series", ids);
|
|
|
|
LOG("info", "Invalidating series", ids);
|
|
|
|
ids.forEach((id) => {
|
|
|
|
ids.forEach((id) => {
|
|
|
|
queryClient.invalidateQueries({ queryKey: [QueryKeys.Series, id] });
|
|
|
|
void queryClient.invalidateQueries({
|
|
|
|
|
|
|
|
queryKey: [QueryKeys.Series, id],
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
delete: (ids) => {
|
|
|
|
delete: (ids) => {
|
|
|
|
LOG("info", "Invalidating series", ids);
|
|
|
|
LOG("info", "Invalidating series", ids);
|
|
|
|
ids.forEach((id) => {
|
|
|
|
ids.forEach((id) => {
|
|
|
|
queryClient.invalidateQueries({ queryKey: [QueryKeys.Series, id] });
|
|
|
|
void queryClient.invalidateQueries({
|
|
|
|
|
|
|
|
queryKey: [QueryKeys.Series, id],
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -55,13 +59,17 @@ export function createDefaultReducer(): SocketIO.Reducer[] {
|
|
|
|
update: (ids) => {
|
|
|
|
update: (ids) => {
|
|
|
|
LOG("info", "Invalidating movies", ids);
|
|
|
|
LOG("info", "Invalidating movies", ids);
|
|
|
|
ids.forEach((id) => {
|
|
|
|
ids.forEach((id) => {
|
|
|
|
queryClient.invalidateQueries({ queryKey: [QueryKeys.Movies, id] });
|
|
|
|
void queryClient.invalidateQueries({
|
|
|
|
|
|
|
|
queryKey: [QueryKeys.Movies, id],
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
delete: (ids) => {
|
|
|
|
delete: (ids) => {
|
|
|
|
LOG("info", "Invalidating movies", ids);
|
|
|
|
LOG("info", "Invalidating movies", ids);
|
|
|
|
ids.forEach((id) => {
|
|
|
|
ids.forEach((id) => {
|
|
|
|
queryClient.invalidateQueries({ queryKey: [QueryKeys.Movies, id] });
|
|
|
|
void queryClient.invalidateQueries({
|
|
|
|
|
|
|
|
queryKey: [QueryKeys.Movies, id],
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -78,7 +86,7 @@ export function createDefaultReducer(): SocketIO.Reducer[] {
|
|
|
|
id,
|
|
|
|
id,
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
if (episode !== undefined) {
|
|
|
|
if (episode !== undefined) {
|
|
|
|
queryClient.invalidateQueries({
|
|
|
|
void queryClient.invalidateQueries({
|
|
|
|
queryKey: [QueryKeys.Series, episode.sonarrSeriesId],
|
|
|
|
queryKey: [QueryKeys.Series, episode.sonarrSeriesId],
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -92,7 +100,7 @@ export function createDefaultReducer(): SocketIO.Reducer[] {
|
|
|
|
id,
|
|
|
|
id,
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
if (episode !== undefined) {
|
|
|
|
if (episode !== undefined) {
|
|
|
|
queryClient.invalidateQueries({
|
|
|
|
void queryClient.invalidateQueries({
|
|
|
|
queryKey: [QueryKeys.Series, episode.sonarrSeriesId],
|
|
|
|
queryKey: [QueryKeys.Series, episode.sonarrSeriesId],
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -101,28 +109,28 @@ export function createDefaultReducer(): SocketIO.Reducer[] {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "episode-wanted",
|
|
|
|
key: "episode-wanted",
|
|
|
|
update: (ids) => {
|
|
|
|
update: () => {
|
|
|
|
// Find a better way to update wanted
|
|
|
|
// Find a better way to update wanted
|
|
|
|
queryClient.invalidateQueries({
|
|
|
|
void queryClient.invalidateQueries({
|
|
|
|
queryKey: [QueryKeys.Episodes, QueryKeys.Wanted],
|
|
|
|
queryKey: [QueryKeys.Episodes, QueryKeys.Wanted],
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
delete: () => {
|
|
|
|
delete: () => {
|
|
|
|
queryClient.invalidateQueries({
|
|
|
|
void queryClient.invalidateQueries({
|
|
|
|
queryKey: [QueryKeys.Episodes, QueryKeys.Wanted],
|
|
|
|
queryKey: [QueryKeys.Episodes, QueryKeys.Wanted],
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "movie-wanted",
|
|
|
|
key: "movie-wanted",
|
|
|
|
update: (ids) => {
|
|
|
|
update: () => {
|
|
|
|
// Find a better way to update wanted
|
|
|
|
// Find a better way to update wanted
|
|
|
|
queryClient.invalidateQueries({
|
|
|
|
void queryClient.invalidateQueries({
|
|
|
|
queryKey: [QueryKeys.Movies, QueryKeys.Wanted],
|
|
|
|
queryKey: [QueryKeys.Movies, QueryKeys.Wanted],
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
delete: () => {
|
|
|
|
delete: () => {
|
|
|
|
queryClient.invalidateQueries({
|
|
|
|
void queryClient.invalidateQueries({
|
|
|
|
queryKey: [QueryKeys.Movies, QueryKeys.Wanted],
|
|
|
|
queryKey: [QueryKeys.Movies, QueryKeys.Wanted],
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -130,13 +138,13 @@ export function createDefaultReducer(): SocketIO.Reducer[] {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "settings",
|
|
|
|
key: "settings",
|
|
|
|
any: () => {
|
|
|
|
any: () => {
|
|
|
|
queryClient.invalidateQueries({ queryKey: [QueryKeys.System] });
|
|
|
|
void queryClient.invalidateQueries({ queryKey: [QueryKeys.System] });
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "languages",
|
|
|
|
key: "languages",
|
|
|
|
any: () => {
|
|
|
|
any: () => {
|
|
|
|
queryClient.invalidateQueries({
|
|
|
|
void queryClient.invalidateQueries({
|
|
|
|
queryKey: [QueryKeys.System, QueryKeys.Languages],
|
|
|
|
queryKey: [QueryKeys.System, QueryKeys.Languages],
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -144,7 +152,7 @@ export function createDefaultReducer(): SocketIO.Reducer[] {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "badges",
|
|
|
|
key: "badges",
|
|
|
|
any: () => {
|
|
|
|
any: () => {
|
|
|
|
queryClient.invalidateQueries({
|
|
|
|
void queryClient.invalidateQueries({
|
|
|
|
queryKey: [QueryKeys.System, QueryKeys.Badges],
|
|
|
|
queryKey: [QueryKeys.System, QueryKeys.Badges],
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -152,7 +160,7 @@ export function createDefaultReducer(): SocketIO.Reducer[] {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "movie-history",
|
|
|
|
key: "movie-history",
|
|
|
|
any: () => {
|
|
|
|
any: () => {
|
|
|
|
queryClient.invalidateQueries({
|
|
|
|
void queryClient.invalidateQueries({
|
|
|
|
queryKey: [QueryKeys.Movies, QueryKeys.History],
|
|
|
|
queryKey: [QueryKeys.Movies, QueryKeys.History],
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -160,7 +168,7 @@ export function createDefaultReducer(): SocketIO.Reducer[] {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "movie-blacklist",
|
|
|
|
key: "movie-blacklist",
|
|
|
|
any: () => {
|
|
|
|
any: () => {
|
|
|
|
queryClient.invalidateQueries({
|
|
|
|
void queryClient.invalidateQueries({
|
|
|
|
queryKey: [QueryKeys.Movies, QueryKeys.Blacklist],
|
|
|
|
queryKey: [QueryKeys.Movies, QueryKeys.Blacklist],
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -168,7 +176,7 @@ export function createDefaultReducer(): SocketIO.Reducer[] {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "episode-history",
|
|
|
|
key: "episode-history",
|
|
|
|
any: () => {
|
|
|
|
any: () => {
|
|
|
|
queryClient.invalidateQueries({
|
|
|
|
void queryClient.invalidateQueries({
|
|
|
|
queryKey: [QueryKeys.Episodes, QueryKeys.History],
|
|
|
|
queryKey: [QueryKeys.Episodes, QueryKeys.History],
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -176,7 +184,7 @@ export function createDefaultReducer(): SocketIO.Reducer[] {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "episode-blacklist",
|
|
|
|
key: "episode-blacklist",
|
|
|
|
any: () => {
|
|
|
|
any: () => {
|
|
|
|
queryClient.invalidateQueries({
|
|
|
|
void queryClient.invalidateQueries({
|
|
|
|
queryKey: [QueryKeys.Episodes, QueryKeys.Blacklist],
|
|
|
|
queryKey: [QueryKeys.Episodes, QueryKeys.Blacklist],
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -184,7 +192,7 @@ export function createDefaultReducer(): SocketIO.Reducer[] {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "reset-episode-wanted",
|
|
|
|
key: "reset-episode-wanted",
|
|
|
|
any: () => {
|
|
|
|
any: () => {
|
|
|
|
queryClient.invalidateQueries({
|
|
|
|
void queryClient.invalidateQueries({
|
|
|
|
queryKey: [QueryKeys.Episodes, QueryKeys.Wanted],
|
|
|
|
queryKey: [QueryKeys.Episodes, QueryKeys.Wanted],
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -192,7 +200,7 @@ export function createDefaultReducer(): SocketIO.Reducer[] {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "reset-movie-wanted",
|
|
|
|
key: "reset-movie-wanted",
|
|
|
|
any: () => {
|
|
|
|
any: () => {
|
|
|
|
queryClient.invalidateQueries({
|
|
|
|
void queryClient.invalidateQueries({
|
|
|
|
queryKey: [QueryKeys.Movies, QueryKeys.Wanted],
|
|
|
|
queryKey: [QueryKeys.Movies, QueryKeys.Wanted],
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -200,7 +208,7 @@ export function createDefaultReducer(): SocketIO.Reducer[] {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
key: "task",
|
|
|
|
key: "task",
|
|
|
|
any: () => {
|
|
|
|
any: () => {
|
|
|
|
queryClient.invalidateQueries({
|
|
|
|
void queryClient.invalidateQueries({
|
|
|
|
queryKey: [QueryKeys.System, QueryKeys.Tasks],
|
|
|
|
queryKey: [QueryKeys.System, QueryKeys.Tasks],
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|