mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-14 09:25:47 +01:00
🐛 External URL being '' in media requests (#1355)
This commit is contained in:
1
next-env.d.ts
vendored
1
next-env.d.ts
vendored
@@ -1,5 +1,6 @@
|
|||||||
/// <reference types="next" />
|
/// <reference types="next" />
|
||||||
/// <reference types="next/image-types/global" />
|
/// <reference types="next/image-types/global" />
|
||||||
|
/// <reference types="next/navigation-types/compat/navigation" />
|
||||||
|
|
||||||
// NOTE: This file should not be edited
|
// NOTE: This file should not be edited
|
||||||
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { MediaRequest, Users } from '~/widgets/media-requests/media-request-type
|
|||||||
|
|
||||||
import { createTRPCRouter, publicProcedure } from '../trpc';
|
import { createTRPCRouter, publicProcedure } from '../trpc';
|
||||||
import { MediaRequestStatsWidget } from '~/widgets/media-requests/MediaRequestStatsTile';
|
import { MediaRequestStatsWidget } from '~/widgets/media-requests/MediaRequestStatsTile';
|
||||||
|
import { removeTrailingSlash } from 'next/dist/shared/lib/router/utils/remove-trailing-slash';
|
||||||
|
|
||||||
export const mediaRequestsRouter = createTRPCRouter({
|
export const mediaRequestsRouter = createTRPCRouter({
|
||||||
allMedia: publicProcedure
|
allMedia: publicProcedure
|
||||||
@@ -32,10 +33,12 @@ export const mediaRequestsRouter = createTRPCRouter({
|
|||||||
})
|
})
|
||||||
.then(async (response) => {
|
.then(async (response) => {
|
||||||
const body = (await response.json()) as OverseerrResponse;
|
const body = (await response.json()) as OverseerrResponse;
|
||||||
const appUrl = input.widget.properties.replaceLinksWithExternalHost
|
let appUrl = input.widget.properties.replaceLinksWithExternalHost && app.behaviour.externalUrl?.length > 0
|
||||||
? app.behaviour.externalUrl
|
? app.behaviour.externalUrl
|
||||||
: app.url;
|
: app.url;
|
||||||
|
|
||||||
|
appUrl = removeTrailingSlash(appUrl);
|
||||||
|
|
||||||
const requests = await Promise.all(
|
const requests = await Promise.all(
|
||||||
body.results.map(async (item): Promise<MediaRequest> => {
|
body.results.map(async (item): Promise<MediaRequest> => {
|
||||||
const genericItem = await retrieveDetailsForItem(
|
const genericItem = await retrieveDetailsForItem(
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon, Anchor,
|
||||||
Badge,
|
Badge,
|
||||||
Card,
|
Card,
|
||||||
Center,
|
Center,
|
||||||
@@ -155,15 +155,9 @@ function MediaRequestListTile({ widget }: MediaRequestListWidgetProps) {
|
|||||||
{item.airDate && <Text>{item.airDate.split('-')[0]}</Text>}
|
{item.airDate && <Text>{item.airDate.split('-')[0]}</Text>}
|
||||||
<MediaRequestStatusBadge status={item.status} />
|
<MediaRequestStatusBadge status={item.status} />
|
||||||
</Group>
|
</Group>
|
||||||
<Text
|
<Anchor href={item.href}>
|
||||||
sx={{ cursor: 'pointer', '&:hover': { textDecoration: 'underline' } }}
|
|
||||||
lineClamp={1}
|
|
||||||
weight="bold"
|
|
||||||
component="a"
|
|
||||||
href={item.href}
|
|
||||||
>
|
|
||||||
{item.name}
|
{item.name}
|
||||||
</Text>
|
</Anchor>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Stack justify="center">
|
<Stack justify="center">
|
||||||
|
|||||||
Reference in New Issue
Block a user