Skip to content

Commit

Permalink
Fix movie Indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
undyingwraith committed Oct 25, 2024
1 parent 14ec43f commit 9e07e2e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/core/src/Services/Indexer/MovieIndexFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,21 @@ export class MovieIndexFetcher implements IIndexFetcher<IMovieMetaData[]> {
const files = (await this.node.ls(cid)).filter(f => f.type == 'dir');
const index = [];
for (const file of files) {
index.push(await this.extractMovieMetaData(this.node, file));
try {
index.push(await this.extractMovieMetaData(this.node, file));
} catch (ex) {
console.error(ex);
}
}

return index;
}

public async extractMovieMetaData(node: IIpfsService, entry: IFileInfo, skeleton?: any): Promise<IMovieMetaData> {
const files = (await this.node.ls(entry.cid)).filter(f => f.type == 'file');
const videoFile = files.filter(f => f.name.endsWith('.mpd'))[0];
const videoFile = files.find(f => f.name.endsWith('.mpd'));

if (!videoFile) throw new Error('Failed to find video file in ' + entry.name + '|' + entry.cid);

return {
...entry,
Expand Down

0 comments on commit 9e07e2e

Please sign in to comment.