mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2026-01-01 04:08:45 -05:00
fix(jellyfinimportmodal): fix for importing all jellyfin users
This commit is contained in:
@@ -51,6 +51,18 @@ const JellyfinImportModal: React.FC<JellyfinImportProps> = ({
|
|||||||
revalidateOnMount: true,
|
revalidateOnMount: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { data: existingUsers } = useSWR<UserResultsResponse>(
|
||||||
|
`/api/v1/user?take=${children}`
|
||||||
|
);
|
||||||
|
|
||||||
|
data?.forEach((user, pos) => {
|
||||||
|
if (
|
||||||
|
existingUsers?.results.some((data) => data.jellyfinUserId === user.id)
|
||||||
|
) {
|
||||||
|
data?.splice(pos, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const importUsers = async () => {
|
const importUsers = async () => {
|
||||||
setImporting(true);
|
setImporting(true);
|
||||||
|
|
||||||
@@ -119,20 +131,6 @@ const JellyfinImportModal: React.FC<JellyfinImportProps> = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const { data: existingUsers } = useSWR<UserResultsResponse>(
|
|
||||||
`/api/v1/user?take=${children}`
|
|
||||||
);
|
|
||||||
|
|
||||||
data?.forEach((user, pos) => {
|
|
||||||
if (
|
|
||||||
existingUsers?.results.some(
|
|
||||||
(existingUser) => existingUser.jellyfinUserId === user.id
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
delete data[pos];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
loading={!data && !error}
|
loading={!data && !error}
|
||||||
|
|||||||
Reference in New Issue
Block a user