From c47106315ae3c403239cda29c49b4bba51ddccb2 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 2 Apr 2019 18:30:26 +0200 Subject: tslint update --- client/src/assets/player/webtorrent/peertube-chunk-store.ts | 6 +++--- client/src/assets/player/webtorrent/video-renderer.ts | 2 +- client/src/assets/player/webtorrent/webtorrent-plugin.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'client/src/assets/player/webtorrent') diff --git a/client/src/assets/player/webtorrent/peertube-chunk-store.ts b/client/src/assets/player/webtorrent/peertube-chunk-store.ts index 54cc0ea64..66762bef8 100644 --- a/client/src/assets/player/webtorrent/peertube-chunk-store.ts +++ b/client/src/assets/player/webtorrent/peertube-chunk-store.ts @@ -131,7 +131,7 @@ export class PeertubeChunkStore extends EventEmitter { // Chunk in store this.db.transaction('r', this.db.chunks, async () => { const result = await this.db.chunks.get({ id: index }) - if (result === undefined) return cb(null, new Buffer(0)) + if (result === undefined) return cb(null, Buffer.alloc(0)) const buf = result.buf if (!opts) return this.nextTick(cb, null, buf) @@ -162,13 +162,13 @@ export class PeertubeChunkStore extends EventEmitter { } if (this.db) { - await this.db.close() + this.db.close() await this.dropDatabase(this.databaseName) } if (this.expirationDB) { - await this.expirationDB.close() + this.expirationDB.close() this.expirationDB = null } diff --git a/client/src/assets/player/webtorrent/video-renderer.ts b/client/src/assets/player/webtorrent/video-renderer.ts index a3415937b..4dce87112 100644 --- a/client/src/assets/player/webtorrent/video-renderer.ts +++ b/client/src/assets/player/webtorrent/video-renderer.ts @@ -29,7 +29,7 @@ function renderVideo ( function renderMedia (file: any, elem: HTMLVideoElement, opts: RenderMediaOptions, callback: (err: Error, renderer?: any) => void) { const extension = extname(file.name).toLowerCase() - let preparedElem: any = undefined + let preparedElem: any let currentTime = 0 let renderer: any diff --git a/client/src/assets/player/webtorrent/webtorrent-plugin.ts b/client/src/assets/player/webtorrent/webtorrent-plugin.ts index c7182acc9..eee3d4db9 100644 --- a/client/src/assets/player/webtorrent/webtorrent-plugin.ts +++ b/client/src/assets/player/webtorrent/webtorrent-plugin.ts @@ -347,7 +347,7 @@ class WebTorrentPlugin extends Plugin { if (!averageDownloadSpeed) averageDownloadSpeed = this.getAndSaveActualDownloadSpeed() // Limit resolution according to player height - const playerHeight = this.playerElement.offsetHeight as number + const playerHeight = this.playerElement.offsetHeight // We take the first resolution just above the player height // Example: player height is 530px, we want the 720p file instead of 480p -- cgit v1.2.3