Skip to content

Commit

Permalink
Use original file path
Browse files Browse the repository at this point in the history
  • Loading branch information
toresbe committed Jul 20, 2023
1 parent 87a1b0f commit 3177f47
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/scheduling/ScheduledVideo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ export class ScheduledVideo implements ScheduleItem {
}

getFilename() {
const asset = this.entry.video.media!.assets!.find(
({ type }) => type === "broadcastable"
)?.url;
const original = this.entry.video.original;

if (typeof asset === "undefined") {
if (!original?.length) {
const fallback = this.entry.video.media!.assets!.find(
({ type }) => type === "webm"
({ type }) => type === "webm",
)?.url;

if (typeof fallback === "undefined") {
Expand All @@ -38,7 +36,7 @@ export class ScheduledVideo implements ScheduleItem {
return fallback;
}

return asset;
return original;
}

loadbg = async () => {
Expand Down
1 change: 1 addition & 0 deletions src/scheduling/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const makeTestVideo = (): Video => {
categories: [],
createdAt: faker.date.past().toISOString(),
updatedAt: faker.date.recent().toISOString(),
original: faker.internet.url({ appendSlash: false, protocol: "https" }),
organization: {
id: 1,
name: faker.company.name(),
Expand Down

0 comments on commit 3177f47

Please sign in to comment.