feat: add support for content fetch in provider manager and display update button conditionally
This commit is contained in:
parent
0fc2378cfa
commit
a7058346a5
@ -117,6 +117,7 @@ export interface ContentProviderDTO {
|
||||
name: string;
|
||||
url?: string;
|
||||
active?: boolean;
|
||||
supportsContentFetch?: boolean;
|
||||
}
|
||||
|
||||
export interface ContentProviderListDTO {
|
||||
@ -214,9 +215,9 @@ export interface PageMangaImportJobDTO {
|
||||
number?: number;
|
||||
pageable?: PageableObject;
|
||||
numberOfElements?: number;
|
||||
sort?: SortObject;
|
||||
first?: boolean;
|
||||
last?: boolean;
|
||||
sort?: SortObject;
|
||||
empty?: boolean;
|
||||
}
|
||||
|
||||
@ -277,9 +278,9 @@ export interface PageMangaListDTO {
|
||||
number?: number;
|
||||
pageable?: PageableObject;
|
||||
numberOfElements?: number;
|
||||
sort?: SortObject;
|
||||
first?: boolean;
|
||||
last?: boolean;
|
||||
sort?: SortObject;
|
||||
empty?: boolean;
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import {
|
||||
import { Badge } from "@/components/ui/badge.tsx";
|
||||
import { Button } from "@/components/ui/button.tsx";
|
||||
import { Card } from "@/components/ui/card.tsx";
|
||||
import {toast} from "sonner";
|
||||
|
||||
export const ProviderManager = () => {
|
||||
const { data } = useGetContentProviders();
|
||||
@ -15,12 +16,26 @@ export const ProviderManager = () => {
|
||||
const {
|
||||
mutate: mutateFetchContentProviderMangas,
|
||||
isPending: isPendingFetchContentProviderMangas,
|
||||
} = useFetchContentProviderMangas();
|
||||
} = useFetchContentProviderMangas({
|
||||
mutation: {
|
||||
onSuccess: () => {
|
||||
toast.success("Content Provider mangas update queued successfully!");
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const {
|
||||
mutate: mutateFetchAllContentProviderMangas,
|
||||
isPending: isPendingFetchAllContentProviderMangas,
|
||||
} = useFetchAllContentProviderMangas();
|
||||
} = useFetchAllContentProviderMangas(
|
||||
{
|
||||
mutation: {
|
||||
onSuccess: () => {
|
||||
toast.success("All Content Provider mangas update queued successfully!");
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const activeCount = providers?.filter((p) => p.active).length;
|
||||
|
||||
@ -104,6 +119,7 @@ export const ProviderManager = () => {
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{provider.supportsContentFetch && (
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
@ -124,6 +140,7 @@ export const ProviderManager = () => {
|
||||
)}
|
||||
Update
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</Card>
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user