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

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 {