Reduce requested downloader data in queries
This commit is contained in:
@@ -185,28 +185,6 @@ export const FULL_EXTENSION_FIELDS = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const FULL_DOWNLOAD_STATUS = gql`
|
||||
fragment FULL_DOWNLOAD_STATUS on DownloadStatus {
|
||||
queue {
|
||||
chapter {
|
||||
id
|
||||
name
|
||||
sourceOrder
|
||||
isDownloaded
|
||||
manga {
|
||||
id
|
||||
title
|
||||
downloadCount
|
||||
}
|
||||
}
|
||||
progress
|
||||
state
|
||||
tries
|
||||
}
|
||||
state
|
||||
}
|
||||
`;
|
||||
|
||||
export const ABOUT_WEBUI = gql`
|
||||
fragment ABOUT_WEBUI on AboutWebUI {
|
||||
channel
|
||||
|
||||
34
src/lib/graphql/fragments/DownloadFragments.ts
Normal file
34
src/lib/graphql/fragments/DownloadFragments.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import gql from 'graphql-tag';
|
||||
|
||||
export const DOWNLOAD_STATUS_FIELDS = gql`
|
||||
fragment DOWNLOAD_STATUS_FIELDS on DownloadStatus {
|
||||
state
|
||||
|
||||
queue {
|
||||
chapter {
|
||||
id
|
||||
name
|
||||
sourceOrder
|
||||
isDownloaded
|
||||
}
|
||||
|
||||
manga {
|
||||
id
|
||||
title
|
||||
downloadCount
|
||||
}
|
||||
|
||||
progress
|
||||
state
|
||||
tries
|
||||
}
|
||||
}
|
||||
`;
|
||||
File diff suppressed because one or more lines are too long
@@ -7,15 +7,16 @@
|
||||
*/
|
||||
|
||||
import gql from 'graphql-tag';
|
||||
import { FULL_DOWNLOAD_STATUS } from '@/lib/graphql/Fragments';
|
||||
import { DOWNLOAD_STATUS_FIELDS } from '@/lib/graphql/fragments/DownloadFragments.ts';
|
||||
|
||||
export const CLEAR_DOWNLOADER = gql`
|
||||
${FULL_DOWNLOAD_STATUS}
|
||||
${DOWNLOAD_STATUS_FIELDS}
|
||||
|
||||
mutation CLEAR_DOWNLOADER($input: ClearDownloaderInput = {}) {
|
||||
clearDownloader(input: $input) {
|
||||
clientMutationId
|
||||
downloadStatus {
|
||||
...FULL_DOWNLOAD_STATUS
|
||||
...DOWNLOAD_STATUS_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,60 +55,65 @@ export const DELETE_DOWNLOADED_CHAPTERS = gql`
|
||||
`;
|
||||
|
||||
export const DEQUEUE_CHAPTER_DOWNLOAD = gql`
|
||||
${FULL_DOWNLOAD_STATUS}
|
||||
${DOWNLOAD_STATUS_FIELDS}
|
||||
|
||||
mutation DEQUEUE_CHAPTER_DOWNLOAD($input: DequeueChapterDownloadInput!) {
|
||||
dequeueChapterDownload(input: $input) {
|
||||
clientMutationId
|
||||
downloadStatus {
|
||||
...FULL_DOWNLOAD_STATUS
|
||||
...DOWNLOAD_STATUS_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DEQUEUE_CHAPTER_DOWNLOADS = gql`
|
||||
${FULL_DOWNLOAD_STATUS}
|
||||
${DOWNLOAD_STATUS_FIELDS}
|
||||
|
||||
mutation DEQUEUE_CHAPTER_DOWNLOADS($input: DequeueChapterDownloadsInput!) {
|
||||
dequeueChapterDownloads(input: $input) {
|
||||
clientMutationId
|
||||
downloadStatus {
|
||||
...FULL_DOWNLOAD_STATUS
|
||||
...DOWNLOAD_STATUS_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const ENQUEUE_CHAPTER_DOWNLOAD = gql`
|
||||
${FULL_DOWNLOAD_STATUS}
|
||||
${DOWNLOAD_STATUS_FIELDS}
|
||||
|
||||
mutation ENQUEUE_CHAPTER_DOWNLOAD($input: EnqueueChapterDownloadInput!) {
|
||||
enqueueChapterDownload(input: $input) {
|
||||
clientMutationId
|
||||
downloadStatus {
|
||||
...FULL_DOWNLOAD_STATUS
|
||||
...DOWNLOAD_STATUS_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const ENQUEUE_CHAPTER_DOWNLOADS = gql`
|
||||
${FULL_DOWNLOAD_STATUS}
|
||||
${DOWNLOAD_STATUS_FIELDS}
|
||||
|
||||
mutation ENQUEUE_CHAPTER_DOWNLOADS($input: EnqueueChapterDownloadsInput!) {
|
||||
enqueueChapterDownloads(input: $input) {
|
||||
clientMutationId
|
||||
downloadStatus {
|
||||
...FULL_DOWNLOAD_STATUS
|
||||
...DOWNLOAD_STATUS_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const REORDER_CHAPTER_DOWNLOAD = gql`
|
||||
${FULL_DOWNLOAD_STATUS}
|
||||
${DOWNLOAD_STATUS_FIELDS}
|
||||
|
||||
mutation REORDER_CHAPTER_DOWNLOAD($input: ReorderChapterDownloadInput!) {
|
||||
reorderChapterDownload(input: $input) {
|
||||
clientMutationId
|
||||
downloadStatus {
|
||||
...FULL_DOWNLOAD_STATUS
|
||||
...DOWNLOAD_STATUS_FIELDS
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
*/
|
||||
|
||||
import gql from 'graphql-tag';
|
||||
import { FULL_DOWNLOAD_STATUS } from '@/lib/graphql/Fragments';
|
||||
import { DOWNLOAD_STATUS_FIELDS } from '@/lib/graphql/fragments/DownloadFragments.ts';
|
||||
|
||||
export const GET_DOWNLOAD_STATUS = gql`
|
||||
${FULL_DOWNLOAD_STATUS}
|
||||
${DOWNLOAD_STATUS_FIELDS}
|
||||
|
||||
query GET_DOWNLOAD_STATUS {
|
||||
downloadStatus {
|
||||
...FULL_DOWNLOAD_STATUS
|
||||
...DOWNLOAD_STATUS_FIELDS
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
*/
|
||||
|
||||
import gql from 'graphql-tag';
|
||||
import { FULL_DOWNLOAD_STATUS } from '@/lib/graphql/Fragments';
|
||||
import { DOWNLOAD_STATUS_FIELDS } from '@/lib/graphql/fragments/DownloadFragments.ts';
|
||||
|
||||
export const DOWNLOAD_STATUS_SUBSCRIPTION = gql`
|
||||
${FULL_DOWNLOAD_STATUS}
|
||||
${DOWNLOAD_STATUS_FIELDS}
|
||||
|
||||
subscription DOWNLOAD_STATUS_SUBSCRIPTION {
|
||||
downloadChanged {
|
||||
...FULL_DOWNLOAD_STATUS
|
||||
...DOWNLOAD_STATUS_FIELDS
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -283,12 +283,7 @@ import { DOWNLOAD_STATUS_SUBSCRIPTION } from '@/lib/graphql/subscriptions/Downlo
|
||||
import { UPDATER_SUBSCRIPTION } from '@/lib/graphql/subscriptions/UpdaterSubscription.ts';
|
||||
import { GET_SERVER_SETTINGS } from '@/lib/graphql/queries/SettingsQuery.ts';
|
||||
import { UPDATE_SERVER_SETTINGS } from '@/lib/graphql/mutations/SettingsMutation.ts';
|
||||
import {
|
||||
BASE_MANGA_FIELDS,
|
||||
FULL_DOWNLOAD_STATUS,
|
||||
FULL_EXTENSION_FIELDS,
|
||||
GLOBAL_METADATA,
|
||||
} from '@/lib/graphql/Fragments.ts';
|
||||
import { BASE_MANGA_FIELDS, FULL_EXTENSION_FIELDS, GLOBAL_METADATA } from '@/lib/graphql/Fragments.ts';
|
||||
import { CLEAR_SERVER_CACHE } from '@/lib/graphql/mutations/ImageMutation.ts';
|
||||
import { RESET_WEBUI_UPDATE_STATUS, UPDATE_WEBUI } from '@/lib/graphql/mutations/ServerInfoMutation.ts';
|
||||
import { WEBUI_UPDATE_SUBSCRIPTION } from '@/lib/graphql/subscriptions/ServerInfoSubscription.ts';
|
||||
@@ -307,6 +302,7 @@ import {
|
||||
} from '@/lib/graphql/mutations/TrackerMutation.ts';
|
||||
import { ControlledPromise } from '@/lib/ControlledPromise.ts';
|
||||
import { MetadataMigrationSettings, TManga } from '@/typings.ts';
|
||||
import { DOWNLOAD_STATUS_FIELDS } from '@/lib/graphql/fragments/DownloadFragments.ts';
|
||||
|
||||
enum GQLMethod {
|
||||
QUERY = 'QUERY',
|
||||
@@ -2334,7 +2330,7 @@ export class RequestManager {
|
||||
DownloadStatusSubscription['downloadChanged']
|
||||
>({
|
||||
id: 'DownloadStatus:{}',
|
||||
fragment: FULL_DOWNLOAD_STATUS,
|
||||
fragment: DOWNLOAD_STATUS_FIELDS,
|
||||
});
|
||||
|
||||
if (!variables) {
|
||||
|
||||
Reference in New Issue
Block a user