Skip to content

Commit

Permalink
Merge pull request #76 from Suwayomi/main
Browse files Browse the repository at this point in the history
add downloading status to /manga/id and no more "Loading..."
  • Loading branch information
Robonau authored Nov 12, 2023
2 parents add6d56 + dea6b9c commit 35e82e3
Show file tree
Hide file tree
Showing 17 changed files with 3,927 additions and 4,325 deletions.
152 changes: 152 additions & 0 deletions src/gql/Fragments.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
fragment ChapterTypeFragment on ChapterType {
isBookmarked
isDownloaded
isRead
id
chapterNumber
fetchedAt
lastPageRead
name
sourceOrder
uploadDate
pageCount
scanlator
}

fragment MangaTypeFragment on MangaType {
artist
author
description
genre
id
inLibrary
lastFetchedAt
realUrl
status
title
thumbnailUrl
unreadCount
downloadCount
lastReadChapter {
lastReadAt
}
meta {
value
key
}
source {
displayName
}
categories {
nodes {
id
}
}
}

fragment SourceTypeFragment on SourceType {
id
displayName
iconUrl
lang
}

fragment PreferenceFragment on Preference {
... on CheckBoxPreference {
CheckBoxCheckBoxCurrentValue: currentValue
summary
CheckBoxDefault: default
key
CheckBoxTitle: title
}
... on EditTextPreference {
EditTextCurrentValue: currentValue
EditTextDefault: default
EditTextTitle: title
text
summary
key
dialogTitle
dialogMessage
}
... on SwitchPreference {
SwitchCurrentValue: currentValue
summary
key
SwitchDefault: default
SwitchTitle: title
}
... on MultiSelectListPreference {
dialogMessage
dialogTitle
MultiSelectListTitle: title
summary
key
entryValues
entries
MultiSelectListDefault: default
MultiSelectListCurrentValue: currentValue
}
... on ListPreference {
ListCurrentValue: currentValue
ListDefault: default
ListTitle: title
summary
key
entryValues
entries
}
}

fragment FilterFragment on Filter {
... on TriStateFilter {
__typename
name
TriStateDefault: default
}
... on CheckBoxFilter {
__typename
CheckBoxDefault: default
name
}
... on TextFilter {
__typename
name
TextDefault: default
}
... on SortFilter {
__typename
values
name
SortDefault: default {
ascending
index
}
}
... on SeparatorFilter {
__typename
name
}
... on SelectFilter {
__typename
values
name
SelectDefault: default
}
... on HeaderFilter {
__typename
name
}
}

fragment ExtensionTypeFragment on ExtensionType {
name
versionName
pkgName
lang
iconUrl
isNsfw
isInstalled
isObsolete
hasUpdate
}
130 changes: 8 additions & 122 deletions src/gql/Mutations.gql
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
mutation fetchExtensions {
fetchExtensions(input: {}) {
extensions {
name
versionName
pkgName
lang
iconUrl
isNsfw
isInstalled
isObsolete
hasUpdate
...ExtensionTypeFragment
}
}
}
Expand Down Expand Up @@ -104,45 +96,15 @@ mutation deleteMangaMeta($id: Int!, $key: String!) {
mutation fetchMangaInfo($id: Int!) {
fetchManga(input: { id: $id }) {
manga {
artist
author
description
genre
id
inLibrary
lastFetchedAt
realUrl
status
title
thumbnailUrl
unreadCount
downloadCount
meta {
value
key
}
source {
displayName
}
...MangaTypeFragment
}
}
}

mutation fetchMangaChapters($id: Int!) {
fetchChapters(input: { mangaId: $id }) {
chapters {
isBookmarked
isDownloaded
isRead
id
chapterNumber
fetchedAt
lastPageRead
name
sourceOrder
uploadDate
pageCount
scanlator
...ChapterTypeFragment
}
}
}
Expand All @@ -157,22 +119,11 @@ mutation updateExtension(
input: { id: $pkgName, patch: { install: $install, uninstall: $uninstall, update: $update } }
) {
extension {
name
versionName
pkgName
lang
iconUrl
isNsfw
isInstalled
isObsolete
hasUpdate
...ExtensionTypeFragment
source {
nodes {
displayName
id
lang
...SourceTypeFragment
isNsfw
iconUrl
extension {
pkgName
}
Expand Down Expand Up @@ -228,50 +179,7 @@ mutation updateSourcePreference(
source {
id
preferences {
... on CheckBoxPreference {
CheckBoxCheckBoxCurrentValue: currentValue
summary
CheckBoxDefault: default
key
CheckBoxTitle: title
}
... on EditTextPreference {
EditTextCurrentValue: currentValue
EditTextDefault: default
EditTextTitle: title
text
summary
key
dialogTitle
dialogMessage
}
... on SwitchPreference {
SwitchCurrentValue: currentValue
summary
key
SwitchDefault: default
SwitchTitle: title
}
... on MultiSelectListPreference {
dialogMessage
dialogTitle
MultiSelectListTitle: title
summary
key
entryValues
entries
MultiSelectListDefault: default
MultiSelectListCurrentValue: currentValue
}
... on ListPreference {
ListCurrentValue: currentValue
ListDefault: default
ListTitle: title
summary
key
entryValues
entries
}
...PreferenceFragment
}
}
}
Expand Down Expand Up @@ -439,37 +347,15 @@ mutation stopDownloader {
mutation deleteDownloadedChapter($id: Int!) {
deleteDownloadedChapter(input: { id: $id }) {
chapters {
isBookmarked
isDownloaded
isRead
id
chapterNumber
fetchedAt
lastPageRead
name
sourceOrder
uploadDate
pageCount
scanlator
...ChapterTypeFragment
}
}
}

mutation deleteDownloadedChapters($ids: [Int!]!) {
deleteDownloadedChapters(input: { ids: $ids }) {
chapters {
isBookmarked
isDownloaded
isRead
id
chapterNumber
fetchedAt
lastPageRead
name
sourceOrder
uploadDate
pageCount
scanlator
...ChapterTypeFragment
}
}
}
Loading

0 comments on commit 35e82e3

Please sign in to comment.