Compare commits

..

No commits in common. "23a094c36e1ce230e0e434722e65d46d2251d112" and "750f91452be3ac8fe6b29f9933f5951b6faef2f2" have entirely different histories.

3 changed files with 7 additions and 10 deletions

View file

@ -20,3 +20,4 @@ COPY --from=builder /src/vite.config.js .
EXPOSE 8080
CMD [ "yarn", "preview", "--host", "--port", "8080" ]
# CMD [ "env" ]

View file

@ -1,5 +1,5 @@
export const API_ROOT_URL = new URL("http://techgames.gnetx.com/infoscreen");
export const CONTENT_ROOT_URL = new URL("/listings", API_ROOT_URL);
export const API_ROOT_URL = "http://techgames.gnetx.com/infoscreen";
export const CONTENT_ROOT_URL = `${API_ROOT_URL}/listings`;
export enum ListingType {
IMAGE = "IMAGE",
@ -25,6 +25,6 @@ export async function fetchData(): Promise<Data> {
return await response.json();
}
export function generateContentURL(content: string): URL {
return new URL(encodeURIComponent(content), CONTENT_ROOT_URL);
export function generateContentURL(content: string): string {
return `${CONTENT_ROOT_URL}/${encodeURIComponent(content)}`;
}

View file

@ -42,9 +42,7 @@
{#if data.listings[listingIndex].type == api.ListingType.IMAGE}
<img
class="center dynamic-size"
src={api
.generateContentURL(data.listings[listingIndex].content)
.toString()}
src={api.generateContentURL(data.listings[listingIndex].content)}
alt={data.listings[listingIndex].name}
on:load={() =>
handleTime(
@ -65,9 +63,7 @@
on:ended={() => updateListingIndex(data.listings.length)}
>
<source
src={api
.generateContentURL(data.listings[listingIndex].content)
.toString()}
src={api.generateContentURL(data.listings[listingIndex].content)}
/>
<track kind="captions" />
<b class="error">Videos are not supported!</b>