mirror of
https://github.com/sct/overseerr.git
synced 2025-12-28 00:54:03 +01: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,
|
||||
});
|
||||
|
||||
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 () => {
|
||||
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 (
|
||||
<Modal
|
||||
loading={!data && !error}
|
||||
|
||||
Reference in New Issue
Block a user