diff options
author | Chocobozzz <me@florianbigard.com> | 2020-09-17 09:20:52 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-11-09 15:33:04 +0100 |
commit | c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e (patch) | |
tree | 79304b0152b0a38d33b26e65d4acdad0da4032a7 /server/helpers/core-utils.ts | |
parent | 110d463fece85e87a26aca48a6048ae0017a27b3 (diff) | |
download | PeerTube-c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e.tar.gz PeerTube-c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e.tar.zst PeerTube-c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e.zip |
Live streaming implementation first step
Diffstat (limited to 'server/helpers/core-utils.ts')
-rw-r--r-- | server/helpers/core-utils.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/server/helpers/core-utils.ts b/server/helpers/core-utils.ts index b1f5d9610..49eee7c59 100644 --- a/server/helpers/core-utils.ts +++ b/server/helpers/core-utils.ts | |||
@@ -175,6 +175,16 @@ function pageToStartAndCount (page: number, itemsPerPage: number) { | |||
175 | return { start, count: itemsPerPage } | 175 | return { start, count: itemsPerPage } |
176 | } | 176 | } |
177 | 177 | ||
178 | function mapToJSON (map: Map<any, any>) { | ||
179 | const obj: any = {} | ||
180 | |||
181 | for (const [ k, v ] of map) { | ||
182 | obj[k] = v | ||
183 | } | ||
184 | |||
185 | return obj | ||
186 | } | ||
187 | |||
178 | function buildPath (path: string) { | 188 | function buildPath (path: string) { |
179 | if (isAbsolute(path)) return path | 189 | if (isAbsolute(path)) return path |
180 | 190 | ||
@@ -263,6 +273,7 @@ export { | |||
263 | 273 | ||
264 | sha256, | 274 | sha256, |
265 | sha1, | 275 | sha1, |
276 | mapToJSON, | ||
266 | 277 | ||
267 | promisify0, | 278 | promisify0, |
268 | promisify1, | 279 | promisify1, |