-
+
{props.hub.continueWatching?.length ? (
) : null}
@@ -657,8 +683,79 @@ function HubPageView(props: {
)
}
-function HeroShowcase({ hero, onOpenCard }: { hero: MediaCard[]; onOpenCard: (card: MediaCard) => void }) {
- const featured = hero[0]
+function HeroShowcase({ hero, onOpenCard, tmdbToken }: { hero: MediaCard[]; onOpenCard: (card: MediaCard) => void; tmdbToken: string }) {
+ const [activeIndex, setActiveIndex] = useState(0)
+ const [activeLogoUrl, setActiveLogoUrl] = useState('')
+
+ useEffect(() => {
+ setActiveIndex((current) => (hero.length ? Math.min(current, hero.length - 1) : 0))
+ }, [hero])
+
+ useEffect(() => {
+ if (hero.length <= 1) {
+ return
+ }
+
+ const interval = window.setInterval(() => {
+ setActiveIndex((current) => (current + 1) % hero.length)
+ }, 9000)
+
+ return () => window.clearInterval(interval)
+ }, [hero])
+
+ const featured = hero[activeIndex]
+
+ useEffect(() => {
+ if (!featured?.tmdbId) {
+ setActiveLogoUrl('')
+ return
+ }
+
+ const mediaType = featured.mediaType === 'movie' ? 'movie' : featured.mediaType === 'tv' || featured.mediaType === 'series' ? 'tv' : ''
+ if (!mediaType) {
+ setActiveLogoUrl('')
+ return
+ }
+
+ let cancelled = false
+
+ const fetchImages = tmdbToken
+ ? fetch(`https://api.themoviedb.org/3/${mediaType}/${featured.tmdbId}/images`, {
+ headers: {
+ Authorization: `Bearer ${tmdbToken}`,
+ },
+ })
+ : fetch(`/api/tmdb/logo?tmdbId=${featured.tmdbId}&mediaType=${mediaType}`)
+
+ void fetchImages
+ .then(async (response) => {
+ if (!response.ok) {
+ throw new Error('Failed to load logo')
+ }
+
+ return response.json() as Promise<{
+ logos?: Array<{ file_path: string; iso_639_1: string | null }>
+ backdrops?: Array<{ file_path: string; iso_639_1: string | null }>
+ }>
+ })
+ .then((payload) => {
+ if (!cancelled) {
+ const englishLogos = payload.logos?.filter((logo) => logo.iso_639_1 === 'en') || []
+ const logo = englishLogos[0] || payload.logos?.[0]
+ setActiveLogoUrl(logo?.file_path ? `https://image.tmdb.org/t/p/original${logo.file_path}` : '')
+ }
+ })
+ .catch(() => {
+ if (!cancelled) {
+ setActiveLogoUrl('')
+ }
+ })
+
+ return () => {
+ cancelled = true
+ }
+ }, [featured])
+
if (!featured) {
return (
@@ -671,30 +768,63 @@ function HeroShowcase({ hero, onOpenCard }: { hero: MediaCard[]; onOpenCard: (ca
)
}
- const heroImage = featured.backdropUrl || featured.posterUrl
-
return (
onOpenCard(featured)}
- style={heroImage
- ? { backgroundImage: `linear-gradient(180deg, rgba(6,10,18,0.12), rgba(7,7,10,0.94)), url("${heroImage}")` }
- : undefined}
>
-
-
{featured.badge || 'Featured'}
-
{featured.title}
-
{featured.overview || featured.subtitle}
+
+ {hero.slice(0, 6).map((card, index) => (
+
+ ))}
+
+
+
+
+ {activeLogoUrl ? (
+

+ ) : (
+
{featured.title}
+ )}
+
- {hero.slice(0, 6).map((card) => (
-
+ {hero.slice(0, 6).map((card, index) => (
+
)
}
+function resolveHeroSlideStyle(card: MediaCard | undefined) {
+ if (!card) {
+ return undefined
+ }
+
+ const slideImage = card.backdropUrl || card.posterUrl
+
+ return slideImage ? { backgroundImage: `url("${slideImage}")` } : undefined
+}
+
function SectionCarousel(props: {
section: HubPageResponse['sections'][number]
onRequest: (card: MediaCard) => Promise
@@ -704,12 +834,14 @@ function SectionCarousel(props: {
if (!props.section.items.length) return null
return (
-
+
{props.section.title}
-
- {props.section.items.map((card) => (
-
- ))}
+
+
+ {props.section.items.map((card) => (
+
+ ))}
+
)
@@ -717,32 +849,23 @@ function SectionCarousel(props: {
function MediaTile(props: {
card: MediaCard
+ isContinueWatching: boolean
styleType: 'poster' | 'landscape' | 'profile' | 'genre' | 'network' | 'episode'
busy: boolean
onOpenCard: (card: MediaCard) => void
onRequest: (card: MediaCard) => Promise
}) {
- const actionable = Boolean(props.card.tmdbId && (props.card.mediaType === 'movie' || props.card.mediaType === 'tv'))
const imageUrl = props.styleType === 'landscape' || props.styleType === 'episode'
? (props.card.backdropUrl || props.card.posterUrl)
: props.card.posterUrl
return (
-
+
-
-
{props.card.badge || props.card.subtitle}
-
{props.card.title}
-
{props.card.secondaryValue || props.card.subtitle}
- {actionable ? (
-
- ) : null}
-
)
}
@@ -754,36 +877,56 @@ function TitleDetailsModal(props: {
onRequest: (card: MediaCard) => Promise
}) {
const canPlay = Boolean(props.card.providerId && props.config.jellyfin.baseUrl)
- const canRequest = Boolean(props.card.tmdbId && (props.card.mediaType === 'movie' || props.card.mediaType === 'tv'))
+ const canRequest = Boolean(props.card.tmdbId && props.card.mediaType !== 'mixed')
const backgroundImage = props.card.backdropUrl || props.card.posterUrl
-
- function handlePlay() {
- if (!props.card.providerId || !props.config.jellyfin.baseUrl) return
- const baseUrl = props.config.jellyfin.baseUrl.replace(/\/$/, '')
- window.open(`${baseUrl}/web/#/details?id=${encodeURIComponent(props.card.providerId)}`, '_blank', 'noopener,noreferrer')
- }
+ const [playerOpen, setPlayerOpen] = useState(false)
+ const requestLabel = props.card.mediaType === 'movie' ? 'Add to Radarr' : 'Add to Sonarr'
+ const jellyfinPlayerUrl = canPlay
+ ? `${props.config.jellyfin.baseUrl.replace(/\/$/, '')}/web/#/details?id=${encodeURIComponent(props.card.providerId!)}&autoplay=true`
+ : ''
return (
-
event.stopPropagation()} role="dialog" aria-modal="true">
-
-
-
-
+
event.stopPropagation()} role="dialog" aria-modal="true">
+
+
+
+
+
+
+
{props.card.badge || props.card.subtitle || 'Title'}
+
{props.card.title}
+ {props.card.subtitle ?
{props.card.subtitle}
: null}
+
+ {canPlay ? : null}
+ {canRequest ? : null}
+
+
+
+
+
+ {playerOpen && jellyfinPlayerUrl ? (
+
+
+
+ ) : null}
+
+
+
{props.card.posterUrl ?

:
}
-
-
{props.card.badge || props.card.subtitle || 'Title'}
-
{props.card.title}
+
+
{props.card.title}
{props.card.overview || props.card.subtitle || 'No details available yet.'}
{props.card.subtitle ? {props.card.subtitle} : null}
{props.card.secondaryValue ? {props.card.secondaryValue} : null}
-
- {canPlay ? : null}
- {canRequest ? : null}
-
@@ -824,6 +967,7 @@ function DownloadRow({ item }: { item: DownloadItem }) {
function SettingsView(props: {
config: AppConfig
+ connections: ConnectionStatus[]
jellyfinUsersBusy: boolean
onLoadJellyfinUsers: () => Promise
updateConfig: (key: K, value: AppConfig[K]) => void
@@ -833,6 +977,20 @@ function SettingsView(props: {
}) {
return (