fix: PDF page count

This will emit a malformed 642 byte PDF file.
This commit is contained in:
Xmader 2021-01-27 11:20:29 -05:00
parent 4bd5d55676
commit e9ed0812b9
No known key found for this signature in database
GPG Key ID: A20B97FB9EB730E4
1 changed files with 6 additions and 1 deletions

View File

@ -106,7 +106,12 @@ export class SheetInfoInPage extends SheetInfo {
constructor (private document: Document) { super() }
get pageCount (): number {
return this.document.querySelectorAll('._2uWw4').length
const sheet0Img = this.document.querySelector('img[src*=score_]')
const sheet0Div = sheet0Img?.parentElement
if (!sheet0Div) {
throw new Error('no sheet images found')
}
return this.document.getElementsByClassName(sheet0Div.className).length
}
get thumbnailUrl (): string {