Skip to content

Commit

Permalink
Correct media path generation
Browse files Browse the repository at this point in the history
Also include vscode settings
  • Loading branch information
toresbe committed Jun 30, 2023
1 parent e4463cd commit 933e1d3
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 2 deletions.
38 changes: 38 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch via NPM with Kubernetes",
"request": "launch",
"runtimeArgs": [
"dev"
],
"runtimeExecutable": "yarn",
"skipFiles": [
"<node_internals>/**"
],
"envFile": "${workspaceFolder}/.env",
"type": "node",
"preLaunchTask": "bridge-to-kubernetes.resource",
"env": {
"GRPC_DNS_RESOLVER": "native"
}
},
{
"name": "Launch via NPM",
"request": "launch",
"runtimeArgs": [
"dev"
],
"envFile": "${workspaceFolder}/.env",
"runtimeExecutable": "yarn",
"skipFiles": [
"<node_internals>/**"
],
"type": "node"
}
]
}
17 changes: 17 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "bridge-to-kubernetes.resource",
"type": "bridge-to-kubernetes.resource",
"resource": "toches",
"resourceType": "service",
"ports": [
8080
],
"targetCluster": "microk8s-cluster",
"targetNamespace": "beta",
"useKubernetesServiceEnvironmentVariables": true
}
]
}
4 changes: 2 additions & 2 deletions src/modules/video/helpers/serializeVideoMediaAsset.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { MEDIA_SERVER_BASE_URL } from "../../core/constants"
import { VideoMediaAssetData } from "../models/videoModel"

export const getObjectURL = (locator?: string) => {
Expand All @@ -6,9 +7,8 @@ export const getObjectURL = (locator?: string) => {
const [scheme, ...rest] = locator.split(":")

if (scheme === "S3") {
const mediaUrl = process.env["FK_MEDIA"] ?? ""
const [bucket, ...path] = rest
return `${mediaUrl}/${bucket}/${path.join(":")}`
return `${MEDIA_SERVER_BASE_URL}/${bucket}/${path.join(":")}`
} else if (scheme === "legacy") {
return "https://upload.frikanalen.no/media/" + rest.join(":")
}
Expand Down

0 comments on commit 933e1d3

Please sign in to comment.