diff options
Diffstat (limited to 'client/src/assets/player/webtorrent/peertube-chunk-store.ts')
-rw-r--r-- | client/src/assets/player/webtorrent/peertube-chunk-store.ts | 6 |
1 files changed, 3 insertions, 3 deletions
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 { | |||
131 | // Chunk in store | 131 | // Chunk in store |
132 | this.db.transaction('r', this.db.chunks, async () => { | 132 | this.db.transaction('r', this.db.chunks, async () => { |
133 | const result = await this.db.chunks.get({ id: index }) | 133 | const result = await this.db.chunks.get({ id: index }) |
134 | if (result === undefined) return cb(null, new Buffer(0)) | 134 | if (result === undefined) return cb(null, Buffer.alloc(0)) |
135 | 135 | ||
136 | const buf = result.buf | 136 | const buf = result.buf |
137 | if (!opts) return this.nextTick(cb, null, buf) | 137 | if (!opts) return this.nextTick(cb, null, buf) |
@@ -162,13 +162,13 @@ export class PeertubeChunkStore extends EventEmitter { | |||
162 | } | 162 | } |
163 | 163 | ||
164 | if (this.db) { | 164 | if (this.db) { |
165 | await this.db.close() | 165 | this.db.close() |
166 | 166 | ||
167 | await this.dropDatabase(this.databaseName) | 167 | await this.dropDatabase(this.databaseName) |
168 | } | 168 | } |
169 | 169 | ||
170 | if (this.expirationDB) { | 170 | if (this.expirationDB) { |
171 | await this.expirationDB.close() | 171 | this.expirationDB.close() |
172 | this.expirationDB = null | 172 | this.expirationDB = null |
173 | } | 173 | } |
174 | 174 | ||