Skip to content

Commit

Permalink
Merge pull request #122 from Suwayomi/main
Browse files Browse the repository at this point in the history
extension repo thing
  • Loading branch information
Robonau authored Jan 7, 2024
2 parents 679f399 + 3c5b3b1 commit 24b6943
Show file tree
Hide file tree
Showing 17 changed files with 112 additions and 53 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (c) 2022 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 http://mozilla.org/MPL/2.0/.

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: check

on:
pull_request:
branches: ['main', 'Release']

jobs:
run-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use bun 1.0.10
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install bun dependencies
run: bun i
- name: Run check
run: bun run check
14 changes: 13 additions & 1 deletion schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ type ExtensionType {
lang: String!
name: String!
pkgName: String!
repo: String
versionCode: Int!
versionName: String!
source: SourceNodeList!
Expand Down Expand Up @@ -318,6 +319,7 @@ type MangaType {
status: MangaStatus!
thumbnailUrl: String
title: String!
updateStrategy: UpdateStrategy!
url: String!
age: LongString
categories: CategoryNodeList!
Expand Down Expand Up @@ -424,6 +426,7 @@ type PartialSettingsType implements Settings {
excludeEntryWithUnreadChapters: Boolean
excludeNotStarted: Boolean
excludeUnreadChapters: Boolean
extensionRepos: [String!]
globalUpdateInterval: Float
gqlDebugLogsEnabled: Boolean
initialOpenInBrowserEnabled: Boolean
Expand Down Expand Up @@ -525,6 +528,7 @@ type SettingsType implements Settings {
excludeEntryWithUnreadChapters: Boolean!
excludeNotStarted: Boolean!
excludeUnreadChapters: Boolean!
extensionRepos: [String!]!
globalUpdateInterval: Float!
gqlDebugLogsEnabled: Boolean!
initialOpenInBrowserEnabled: Boolean!
Expand Down Expand Up @@ -630,7 +634,7 @@ type UpdateChaptersPayload {
}
type UpdateExtensionPayload {
clientMutationId: String
extension: ExtensionType!
extension: ExtensionType
}
type UpdateExtensionsPayload {
clientMutationId: String
Expand Down Expand Up @@ -743,6 +747,7 @@ interface Settings {
excludeEntryWithUnreadChapters: Boolean
excludeNotStarted: Boolean
excludeUnreadChapters: Boolean
extensionRepos: [String!]
globalUpdateInterval: Float
gqlDebugLogsEnabled: Boolean
initialOpenInBrowserEnabled: Boolean
Expand Down Expand Up @@ -852,6 +857,10 @@ enum UpdateState {
FINISHED
ERROR
}
enum UpdateStrategy {
ALWAYS_UPDATE
ONLY_FETCH_ONCE
}
enum WebUIChannel {
BUNDLED
STABLE
Expand Down Expand Up @@ -1026,6 +1035,7 @@ input ExtensionConditionInput {
lang: String
name: String
pkgName: String
repo: String
versionCode: Int
versionName: String
}
Expand All @@ -1042,6 +1052,7 @@ input ExtensionFilterInput {
not: ExtensionFilterInput
or: [ExtensionFilterInput!]
pkgName: StringFilterInput
repo: StringFilterInput
versionCode: IntFilterInput
versionName: StringFilterInput
}
Expand Down Expand Up @@ -1212,6 +1223,7 @@ input PartialSettingsTypeInput {
excludeEntryWithUnreadChapters: Boolean
excludeNotStarted: Boolean
excludeUnreadChapters: Boolean
extensionRepos: [String!]
globalUpdateInterval: Float
gqlDebugLogsEnabled: Boolean
initialOpenInBrowserEnabled: Boolean
Expand Down
1 change: 1 addition & 0 deletions src/gql/Fragments.gql
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ fragment SourceTypeFragment on SourceType {

fragment ExtensionTypeFragment on ExtensionType {
name
repo
versionName
pkgName
lang
Expand Down
24 changes: 19 additions & 5 deletions src/lib/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ export type ExtensionConditionInput = {
lang?: InputMaybe<Scalars['String']['input']>;
name?: InputMaybe<Scalars['String']['input']>;
pkgName?: InputMaybe<Scalars['String']['input']>;
repo?: InputMaybe<Scalars['String']['input']>;
versionCode?: InputMaybe<Scalars['Int']['input']>;
versionName?: InputMaybe<Scalars['String']['input']>;
};
Expand All @@ -544,6 +545,7 @@ export type ExtensionFilterInput = {
not?: InputMaybe<ExtensionFilterInput>;
or?: InputMaybe<Array<ExtensionFilterInput>>;
pkgName?: InputMaybe<StringFilterInput>;
repo?: InputMaybe<StringFilterInput>;
versionCode?: InputMaybe<IntFilterInput>;
versionName?: InputMaybe<StringFilterInput>;
};
Expand Down Expand Up @@ -573,6 +575,7 @@ export type ExtensionType = {
lang: Scalars['String']['output'];
name: Scalars['String']['output'];
pkgName: Scalars['String']['output'];
repo?: Maybe<Scalars['String']['output']>;
source: SourceNodeList;
versionCode: Scalars['Int']['output'];
versionName: Scalars['String']['output'];
Expand Down Expand Up @@ -890,6 +893,7 @@ export type MangaType = {
thumbnailUrl?: Maybe<Scalars['String']['output']>;
title: Scalars['String']['output'];
unreadCount: Scalars['Int']['output'];
updateStrategy: UpdateStrategy;
url: Scalars['String']['output'];
};

Expand Down Expand Up @@ -1273,6 +1277,7 @@ export type PartialSettingsType = Settings & {
excludeEntryWithUnreadChapters?: Maybe<Scalars['Boolean']['output']>;
excludeNotStarted?: Maybe<Scalars['Boolean']['output']>;
excludeUnreadChapters?: Maybe<Scalars['Boolean']['output']>;
extensionRepos?: Maybe<Array<Scalars['String']['output']>>;
globalUpdateInterval?: Maybe<Scalars['Float']['output']>;
gqlDebugLogsEnabled?: Maybe<Scalars['Boolean']['output']>;
initialOpenInBrowserEnabled?: Maybe<Scalars['Boolean']['output']>;
Expand Down Expand Up @@ -1309,6 +1314,7 @@ export type PartialSettingsTypeInput = {
excludeEntryWithUnreadChapters?: InputMaybe<Scalars['Boolean']['input']>;
excludeNotStarted?: InputMaybe<Scalars['Boolean']['input']>;
excludeUnreadChapters?: InputMaybe<Scalars['Boolean']['input']>;
extensionRepos?: InputMaybe<Array<Scalars['String']['input']>>;
globalUpdateInterval?: InputMaybe<Scalars['Float']['input']>;
gqlDebugLogsEnabled?: InputMaybe<Scalars['Boolean']['input']>;
initialOpenInBrowserEnabled?: InputMaybe<Scalars['Boolean']['input']>;
Expand Down Expand Up @@ -1593,6 +1599,7 @@ export type Settings = {
excludeEntryWithUnreadChapters?: Maybe<Scalars['Boolean']['output']>;
excludeNotStarted?: Maybe<Scalars['Boolean']['output']>;
excludeUnreadChapters?: Maybe<Scalars['Boolean']['output']>;
extensionRepos?: Maybe<Array<Scalars['String']['output']>>;
globalUpdateInterval?: Maybe<Scalars['Float']['output']>;
gqlDebugLogsEnabled?: Maybe<Scalars['Boolean']['output']>;
initialOpenInBrowserEnabled?: Maybe<Scalars['Boolean']['output']>;
Expand Down Expand Up @@ -1630,6 +1637,7 @@ export type SettingsType = Settings & {
excludeEntryWithUnreadChapters: Scalars['Boolean']['output'];
excludeNotStarted: Scalars['Boolean']['output'];
excludeUnreadChapters: Scalars['Boolean']['output'];
extensionRepos: Array<Scalars['String']['output']>;
globalUpdateInterval: Scalars['Float']['output'];
gqlDebugLogsEnabled: Scalars['Boolean']['output'];
initialOpenInBrowserEnabled: Scalars['Boolean']['output'];
Expand Down Expand Up @@ -1928,7 +1936,7 @@ export type UpdateExtensionPatchInput = {
export type UpdateExtensionPayload = {
__typename?: 'UpdateExtensionPayload';
clientMutationId?: Maybe<Scalars['String']['output']>;
extension: ExtensionType;
extension?: Maybe<ExtensionType>;
};

export type UpdateExtensionsInput = {
Expand Down Expand Up @@ -2062,6 +2070,11 @@ export type UpdateStopPayload = {
clientMutationId?: Maybe<Scalars['String']['output']>;
};

export enum UpdateStrategy {
AlwaysUpdate = 'ALWAYS_UPDATE',
OnlyFetchOnce = 'ONLY_FETCH_ONCE'
}

export type ValidateBackupInput = {
backup: Scalars['Upload']['input'];
};
Expand Down Expand Up @@ -2129,14 +2142,14 @@ export type MangaTypeFragmentFragment = { __typename?: 'MangaType', artist?: str

export type SourceTypeFragmentFragment = { __typename?: 'SourceType', id: any, displayName: string, iconUrl: string, lang: string };

export type ExtensionTypeFragmentFragment = { __typename?: 'ExtensionType', name: string, versionName: string, pkgName: string, lang: string, iconUrl: string, isNsfw: boolean, isInstalled: boolean, isObsolete: boolean, hasUpdate: boolean };
export type ExtensionTypeFragmentFragment = { __typename?: 'ExtensionType', name: string, repo?: string | null, versionName: string, pkgName: string, lang: string, iconUrl: string, isNsfw: boolean, isInstalled: boolean, isObsolete: boolean, hasUpdate: boolean };

export type CategoryTypeFragmentFragment = { __typename?: 'CategoryType', id: number, default: boolean, order: number, name: string, mangas: { __typename?: 'MangaNodeList', totalCount: number } };

export type FetchExtensionsMutationVariables = Exact<{ [key: string]: never; }>;


export type FetchExtensionsMutation = { __typename?: 'Mutation', fetchExtensions: { __typename?: 'FetchExtensionsPayload', extensions: Array<{ __typename?: 'ExtensionType', name: string, versionName: string, pkgName: string, lang: string, iconUrl: string, isNsfw: boolean, isInstalled: boolean, isObsolete: boolean, hasUpdate: boolean }> } };
export type FetchExtensionsMutation = { __typename?: 'Mutation', fetchExtensions: { __typename?: 'FetchExtensionsPayload', extensions: Array<{ __typename?: 'ExtensionType', name: string, repo?: string | null, versionName: string, pkgName: string, lang: string, iconUrl: string, isNsfw: boolean, isInstalled: boolean, isObsolete: boolean, hasUpdate: boolean }> } };

export type UpdateChaptersMutationVariables = Exact<{
ids: Array<Scalars['Int']['input']> | Scalars['Int']['input'];
Expand Down Expand Up @@ -2219,7 +2232,7 @@ export type UpdateExtensionMutationVariables = Exact<{
}>;


export type UpdateExtensionMutation = { __typename?: 'Mutation', updateExtension: { __typename?: 'UpdateExtensionPayload', extension: { __typename?: 'ExtensionType', name: string, versionName: string, pkgName: string, lang: string, iconUrl: string, isNsfw: boolean, isInstalled: boolean, isObsolete: boolean, hasUpdate: boolean, source: { __typename?: 'SourceNodeList', nodes: Array<{ __typename?: 'SourceType', isNsfw: boolean, id: any, displayName: string, iconUrl: string, lang: string, extension: { __typename?: 'ExtensionType', pkgName: string } }> } } } };
export type UpdateExtensionMutation = { __typename?: 'Mutation', updateExtension: { __typename?: 'UpdateExtensionPayload', extension?: { __typename?: 'ExtensionType', name: string, repo?: string | null, versionName: string, pkgName: string, lang: string, iconUrl: string, isNsfw: boolean, isInstalled: boolean, isObsolete: boolean, hasUpdate: boolean, source: { __typename?: 'SourceNodeList', nodes: Array<{ __typename?: 'SourceType', isNsfw: boolean, id: any, displayName: string, iconUrl: string, lang: string, extension: { __typename?: 'ExtensionType', pkgName: string } }> } } | null } };

export type FetchSourceMangaMutationVariables = Exact<{
page: Scalars['Int']['input'];
Expand Down Expand Up @@ -2420,7 +2433,7 @@ export type ExtensionsQueryVariables = Exact<{
}>;


export type ExtensionsQuery = { __typename?: 'Query', extensions: { __typename?: 'ExtensionNodeList', nodes: Array<{ __typename?: 'ExtensionType', name: string, versionName: string, pkgName: string, lang: string, iconUrl: string, isNsfw: boolean, isInstalled: boolean, isObsolete: boolean, hasUpdate: boolean }> } };
export type ExtensionsQuery = { __typename?: 'Query', extensions: { __typename?: 'ExtensionNodeList', nodes: Array<{ __typename?: 'ExtensionType', name: string, repo?: string | null, versionName: string, pkgName: string, lang: string, iconUrl: string, isNsfw: boolean, isInstalled: boolean, isObsolete: boolean, hasUpdate: boolean }> } };

export type SourcesQueryVariables = Exact<{
isNsfw?: InputMaybe<Scalars['Boolean']['input']>;
Expand Down Expand Up @@ -2586,6 +2599,7 @@ export const SourceTypeFragmentFragmentDoc = gql`
export const ExtensionTypeFragmentFragmentDoc = gql`
fragment ExtensionTypeFragment on ExtensionType {
name
repo
versionName
pkgName
lang
Expand Down
4 changes: 2 additions & 2 deletions src/routes/(app)/(library)/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,15 @@
draggable={false}
use:longPress
on:longPress={() => $selectMode || LongHandler()}
href="manga/{manga.id}"
href="/manga/{manga.id}"
on:click|stopPropagation={(e) => {
if (e.ctrlKey) return;
if ($selectMode) {
e.preventDefault();
lastSelected = HelpDoSelect(manga, e, lastSelected, sortedMangas, selected);
} else {
e.preventDefault();
goto(`manga/${manga.id}`);
goto(`/manga/${manga.id}`);
}
}}
class="hover:opacity-70 cursor-pointer h-full"
Expand Down
8 changes: 4 additions & 4 deletions src/routes/(app)/browse/Nav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
>
<div class="py-2 flex space-x-2">
<a
href="sources"
href="/browse/sources"
class="btn
{$page.url.pathname.includes('/browse/sources')
? 'variant-filled-secondary'
Expand All @@ -27,7 +27,7 @@
Sources
</a>
<a
href="extensions"
href="/browse/extensions"
class="btn
{$page.url.pathname.includes('/browse/extensions')
? 'variant-filled-secondary'
Expand All @@ -36,7 +36,7 @@
Extensions
</a>
<a
href="migrate"
href="/browse/migrate"
class="btn
{$page.url.pathname.includes('/browse/migrate')
? 'variant-filled-secondary'
Expand All @@ -45,7 +45,7 @@
Migrate
</a>
<a
href="globalsearch"
href="/browse/globalsearch"
class="btn
{$page.url.pathname.includes('/browse/globalsearch')
? 'variant-filled-secondary'
Expand Down
19 changes: 10 additions & 9 deletions src/routes/(app)/browse/extensions/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@
checkIfFetchNewExtensions();
async function checkIfFetchNewExtensions() {
if ($lastFetched.valueOf() + 8.64e7 < Date.now().valueOf()) {
await ErrorHelp(
'failed to fetch new extensions',
fetchExtensions({
update: fetchExtensionsUpdater
})
);
}
extensions = getExtensions({ variables: { isNsfw: $Meta.nsfw ? null : false } });
await ErrorHelp(
'failed to fetch new extensions',
fetchExtensions({
update: fetchExtensionsUpdater
})
);
extensions = getExtensions({
variables: { isNsfw: $Meta.nsfw ? null : false },
fetchPolicy: 'cache-first'
});
}
function fetchExtensionsUpdater(
Expand Down
Loading

0 comments on commit 24b6943

Please sign in to comment.