Skip to content

Commit

Permalink
Update Paperback.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
FaizanDurrani authored Jan 12, 2024
1 parent 0c4df86 commit 59897e3
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/Paperback/Paperback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { getAuthorizationString,
// - 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.2.11',
version: '1.2.12',
name: 'Paperback',
icon: 'icon.png',
author: 'Lemon | Faizan Durrani',
Expand Down Expand Up @@ -85,15 +85,16 @@ export class KomgaRequestInterceptor implements SourceInterceptor {
return response
}
async interceptRequest(request: Request): Promise<Request> {
// NOTE: Doing it like this will make downloads work tried every other method did not work, if there is a better method make edit it and make pull request
if (request.url.includes('intercept*')) {
const url = request?.url?.split('*').pop() ?? ''
request.headers = {
'authorization': await getAuthorizationString(this.stateManager)
}
request.url = url
return request
}
// Paper's Note: This hack no longer works on iOS 17
// ORIGINAL NOTE: Doing it like this will make downloads work tried every other method did not work, if there is a better method make edit it and make pull request
// if (request.url.includes('intercept*')) {
// const url = request?.url?.split('*').pop() ?? ''
// request.headers = {
// 'authorization': await getAuthorizationString(this.stateManager)
// }
// request.url = url
// return request
// }
if (request.headers === undefined) {
request.headers = {}
}
Expand Down Expand Up @@ -304,10 +305,10 @@ export class Paperback extends Source {
const pages: string[] = []
for (const page of result) {
if (SUPPORTED_IMAGE_TYPES.includes(page.mediaType)) {
pages.push(`intercept*${komgaAPI}/books/${chapterId}/pages/${page.number}`)
pages.push(`${komgaAPI}/books/${chapterId}/pages/${page.number}`)
}
else {
pages.push(`intercept*${komgaAPI}/books/${chapterId}/pages/${page.number}?convert=png`)
pages.push(`${komgaAPI}/books/${chapterId}/pages/${page.number}?convert=png`)
}
}
// Determine the preferred reading direction which is only available in the serie metadata
Expand Down

0 comments on commit 59897e3

Please sign in to comment.