Skip to content

Commit

Permalink
Method to rerun task
Browse files Browse the repository at this point in the history
  • Loading branch information
davidvanleeuwen committed Oct 1, 2024
1 parent 57f49ed commit 544d725
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export class List extends MaveElement {
}
}

refresh(): Promise<unknown> {
return this.embedController.refresh();
}

containsEmbed(embedId: string): boolean {
return this._collection?.videos?.some((video) => video.id === embedId);
}
Expand Down
5 changes: 5 additions & 0 deletions src/embed/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ export class EmbedController {
return Config.cdn.endpoint.replace('${this.spaceId}', this.spaceId);
}

refresh(): Promise<unknown> {
this.loading = true;
return this.task?.run();
}

embedFile(file: string, params = new URLSearchParams()): string {
const url = new URL(
`${this.cdnRoot}/${this.embedId}${file == 'manifest' ? '/' : this.version}${file}`,
Expand Down

0 comments on commit 544d725

Please sign in to comment.