mirror of https://github.com/Chocobozzz/PeerTube
Fix my videos pagination
parent
5b5e333f06
commit
a86887a4b8
|
@ -106,6 +106,11 @@ export class AccountVideosComponent extends AbstractVideoList implements OnInit,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected buildVideoHeight () {
|
||||||
|
// In account videos, the video height is fixed
|
||||||
|
return this.baseVideoHeight
|
||||||
|
}
|
||||||
|
|
||||||
private spliceVideosById (id: number) {
|
private spliceVideosById (id: number) {
|
||||||
for (const key of Object.keys(this.loadedPages)) {
|
for (const key of Object.keys(this.loadedPages)) {
|
||||||
const videos = this.loadedPages[key]
|
const videos = this.loadedPages[key]
|
||||||
|
|
|
@ -169,6 +169,11 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
|
||||||
this.videoPages = Object.values(this.loadedPages)
|
this.videoPages = Object.values(this.loadedPages)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected buildVideoHeight () {
|
||||||
|
// Same ratios than base width/height
|
||||||
|
return this.videosElement.nativeElement.offsetWidth * (this.baseVideoHeight / this.baseVideoWidth)
|
||||||
|
}
|
||||||
|
|
||||||
private minPageLoaded () {
|
private minPageLoaded () {
|
||||||
return Math.min(...Object.keys(this.loadedPages).map(e => parseInt(e, 10)))
|
return Math.min(...Object.keys(this.loadedPages).map(e => parseInt(e, 10)))
|
||||||
}
|
}
|
||||||
|
@ -183,8 +188,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
|
||||||
|
|
||||||
// Video takes all the width
|
// Video takes all the width
|
||||||
this.videoWidth = -1
|
this.videoWidth = -1
|
||||||
// Same ratios than base width/height
|
this.videoHeight = this.buildVideoHeight()
|
||||||
this.videoHeight = this.videosElement.nativeElement.offsetWidth * (this.baseVideoHeight / this.baseVideoWidth)
|
|
||||||
this.pageHeight = this.pagination.itemsPerPage * this.videoHeight
|
this.pageHeight = this.pagination.itemsPerPage * this.videoHeight
|
||||||
} else {
|
} else {
|
||||||
this.videoWidth = this.baseVideoWidth
|
this.videoWidth = this.baseVideoWidth
|
||||||
|
|
Loading…
Reference in New Issue