feat: vod display (#686)

* feat: preview for html5 supported videos

* fix: handle out of limit tags

* feat: support preview on the donwload screen

* refactor: rework meta and preview handling to be more general

* fix: missing meta

* fix: do not allow maybe or probably types

* fix: make the media check more strict

---------

Co-authored-by: Levente Kiss <levente.kiss@solarpunk.bzz>
This commit is contained in:
Levente Kiss
2025-02-12 11:35:46 +01:00
committed by GitHub
parent f695ac3a1c
commit bcd3d50b42
12 changed files with 170 additions and 93 deletions
+8 -2
View File
@@ -50,14 +50,20 @@ export class ManifestJs {
/**
* Retrieves all paths with the associated hashes from a Swarm manifest
*/
public async getHashes(hash: string): Promise<Record<string, string>> {
public async getHashes(hash: string, options?: { exclude: string[] }): Promise<Record<string, string>> {
const data = await this.bee.downloadData(hash)
const node = new MantarayNode()
node.deserialize(data)
await loadAllNodes(this.load.bind(this), node)
const result = {}
const result: Record<string, string> = {}
this.extractHashes(result, node)
if (options?.exclude) {
for (const path of options.exclude) {
delete result[path]
}
}
return result
}