Skip to content

Commit

Permalink
using compat wrapper for 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
FaizanDurrani committed Nov 4, 2024
1 parent fedc382 commit 31f97e6
Show file tree
Hide file tree
Showing 11 changed files with 8,495 additions and 6,421 deletions.
14,836 changes: 8,447 additions & 6,389 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
},
"homepage": "https://github.com/Paperback-iOS/extensions#readme",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.25.0",
"@typescript-eslint/parser": "^4.25.0",
"eslint": "^7.27.0",
"@typescript-eslint/eslint-plugin": "^8.12.2",
"@typescript-eslint/parser": "^8.12.2",
"eslint": "^9.14.0",
"eslint-plugin-modules-newline": "^0.0.6",
"typescript": "^4.3.2"
"typescript": "^5.6.3"
},
"dependencies": {
"@paperback/toolchain": "0.8.0-alpha.47",
"@paperback/types": "0.8.0-alpha.47"
"@paperback/toolchain": "^1.0.0-alpha.24",
"@paperback/types": "^1.0.0-alpha.24"
}
}
2 changes: 1 addition & 1 deletion src/Paperback/Common.ts → src/Komga/Common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { SearchRequest,
PagedResults,
SourceStateManager,
RequestManager,
Response } from '@paperback/types'
Response } from '@paperback/types/lib/compat/0.8'
import { PageSeriesDto } from './data-contracts'
export function getServerUnavailableMangaTiles() {
// This tile is used as a placeholder when the server is unavailable
Expand Down
29 changes: 5 additions & 24 deletions src/Paperback/Paperback.ts → src/Komga/Komga.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Chapter,
ChapterDetails,
ContentRating,
HomeSection,
SourceManga,
PartialSourceManga,
Expand All @@ -11,16 +10,13 @@ import { Chapter,
SearchRequest,
DUISection,
Source,
SourceInfo,
SourceStateManager,
TagSection,
BadgeColor,
SourceInterceptor,
SourceIntents,
MangaProgressProviding,
TrackerActionQueue,
DUIForm
} from '@paperback/types'
} from '@paperback/types/lib/compat/0.8'

import { parseLangCode } from './Languages'
import { resetSettingsButton,
serverSettingsMenu,
Expand All @@ -30,6 +26,7 @@ import { getAuthorizationString,
getOptions,
getServerUnavailableMangaTiles,
searchRequest, } from './Common'

import { BookDto, LibraryDto, PageBookDto, PageCollectionDto, PageDto, ReadProgressUpdateDto, SeriesDto } from './data-contracts'
// This source use Komga REST API
// https://komga.org/guides/rest.html
Expand All @@ -43,23 +40,7 @@ import { BookDto, LibraryDto, PageBookDto, PageCollectionDto, PageDto, ReadProgr
// - homepage sections
// - getTags() which is called on the homepage
// - search method which is called even if the user search in an other source
export const PaperbackInfo: SourceInfo = {
version: '1.3',
name: 'Paperback',
icon: 'icon.png',
author: 'Lemon | Faizan Durrani',
authorWebsite: 'https://github.com/FramboisePi',
description: 'Komga client extension for Paperback',
contentRating: ContentRating.EVERYONE,
websiteBaseURL: 'https://komga.org',
sourceTags: [
{
text: 'Self hosted',
type: BadgeColor.RED
},
],
intents: SourceIntents.MANGA_CHAPTERS | SourceIntents.HOMEPAGE_SECTIONS | SourceIntents.SETTINGS_UI | SourceIntents.MANGA_TRACKING
}

const SUPPORTED_IMAGE_TYPES = [
'image/jpeg',
'image/png',
Expand Down Expand Up @@ -115,7 +96,7 @@ export class KomgaRequestInterceptor implements SourceInterceptor {
return request
}
}
export class Paperback extends Source {
export class Komga extends Source {
stateManager = App.createSourceStateManager();
requestManager = App.createRequestManager({
requestsPerSecond: 4,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Paperback/Settings.ts → src/Komga/Settings.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DUIButton,
DUINavigationButton,
RequestManager,
SourceStateManager } from '@paperback/types'
SourceStateManager } from '@paperback/types/lib/compat/0.8'
import { retrieveStateData,
setStateData,
getKomgaAPI,
Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions src/Komga/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Komga as _Komga } from "./Komga";

import { CompatWrapper } from "@paperback/types/lib/compat/0.8";

export const Komga = CompatWrapper(
{ registerHomeSectionsInInitialise: true },
new _Komga(undefined),
);
27 changes: 27 additions & 0 deletions src/Komga/pbconfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { ContentRating, SourceInfo, SourceIntents } from "@paperback/types"

export default {
version: '2.0',
name: 'Komga',
icon: 'icon.png',
developers: [
{
name: "Faizan Durrani",
github: "FaizanDurrani"
},
{
name: "Lemon",
github: "FramboisePi"
}
],
description: 'Komga client extension for Paperback',
contentRating: ContentRating.EVERYONE,
badges: [
{
label: 'Self hosted',
backgroundColor: "#000000",
textColor: "#ffffff"
},
],
capabilities: SourceIntents.MANGA_CHAPTERS | SourceIntents.HOMEPAGE_SECTIONS | SourceIntents.SETTINGS_UI | SourceIntents.MANGA_TRACKING
} satisfies SourceInfo
Binary file added src/Komga/static/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/Paperback/includes/icon.png
Binary file not shown.

0 comments on commit 31f97e6

Please sign in to comment.