Skip to content

Commit 70497a1

Browse files
authored
refactor(ui): changed the layout (#10)
* immersive layout * added gradient to backdrop image on hero's * more hero adds * light/dark mode support for favicon * added rating to hero * switched it all to immersive I love it * rewrote season view * added next episode banner * download button placement and poster size * docs favicon * trailer and cast improvements * better scroll and loading state
1 parent 8cc31e7 commit 70497a1

34 files changed

+1317
-407
lines changed

backend/internal/http/docs/docs.go

Lines changed: 43 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/internal/http/docs/swagger.json

Lines changed: 43 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/internal/http/docs/swagger.yaml

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/internal/model/media_detail.go

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ type MovieDetail struct {
3333
ReleaseDate string `json:"releaseDate,omitempty"`
3434
Runtime int `json:"runtime,omitempty"`
3535
Certification string `json:"certification,omitempty"`
36+
VoteAverage float64 `json:"voteAverage,omitempty"`
37+
VoteCount int64 `json:"voteCount,omitempty"`
3638
Genres []Genre `json:"genres,omitempty"`
3739
PosterPath string `json:"posterPath,omitempty"`
3840
BackdropPath string `json:"backdropPath,omitempty"`
@@ -63,22 +65,34 @@ type SeasonDetail struct {
6365
Episodes []EpisodeAvailability `json:"episodes"`
6466
}
6567

68+
type NextEpisode struct {
69+
SeasonNumber int `json:"seasonNumber"`
70+
EpisodeNumber int `json:"episodeNumber"`
71+
Title string `json:"title"`
72+
AirDate string `json:"airDate,omitempty"`
73+
Overview string `json:"overview,omitempty"`
74+
StillPath string `json:"stillPath,omitempty"`
75+
}
76+
6677
type SeriesDetail struct {
6778
TmdbID int64 `json:"tmdbId"`
6879
Title string `json:"title"`
6980
Year *int32 `json:"year,omitempty"`
7081

71-
Overview string `json:"overview"`
72-
Tagline string `json:"tagline,omitempty"`
73-
Status string `json:"status"`
74-
FirstAirDate string `json:"firstAirDate,omitempty"`
75-
LastAirDate string `json:"lastAirDate,omitempty"`
76-
InProduction bool `json:"inProduction"`
77-
Certification string `json:"certification,omitempty"`
78-
EpisodeRuntime *int `json:"episodeRuntime,omitempty"`
79-
Genres []Genre `json:"genres,omitempty"`
80-
PosterPath string `json:"posterPath,omitempty"`
81-
BackdropPath string `json:"backdropPath,omitempty"`
82+
Overview string `json:"overview"`
83+
Tagline string `json:"tagline,omitempty"`
84+
Status string `json:"status"`
85+
FirstAirDate string `json:"firstAirDate,omitempty"`
86+
LastAirDate string `json:"lastAirDate,omitempty"`
87+
InProduction bool `json:"inProduction"`
88+
Certification string `json:"certification,omitempty"`
89+
EpisodeRuntime *int `json:"episodeRuntime,omitempty"`
90+
VoteAverage float64 `json:"voteAverage,omitempty"`
91+
VoteCount int64 `json:"voteCount,omitempty"`
92+
Genres []Genre `json:"genres,omitempty"`
93+
PosterPath string `json:"posterPath,omitempty"`
94+
BackdropPath string `json:"backdropPath,omitempty"`
95+
NextEpisodeToAir *NextEpisode `json:"nextEpisodeToAir,omitempty"`
8296

8397
Availability Availability `json:"availability"`
8498
Seasons []SeasonDetail `json:"seasons"`

backend/internal/service/media.go

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,8 @@ func (s *MediaService) GetMovieDetail(ctx context.Context, tmdbID int64) (model.
489489
ReleaseDate: tmdbDetails.ReleaseDate,
490490
Runtime: tmdbDetails.Runtime,
491491
Certification: certification,
492+
VoteAverage: float64(tmdbDetails.VoteAverage),
493+
VoteCount: int64(tmdbDetails.VoteCount),
492494
Genres: genres,
493495
PosterPath: tmdbDetails.PosterPath,
494496
BackdropPath: tmdbDetails.BackdropPath,
@@ -692,6 +694,19 @@ func (s *MediaService) GetSeriesDetail(ctx context.Context, tmdbID int64) (model
692694
watchProviders = extractWatchProviders(tmdbDetails.WatchProviders, region)
693695
}
694696

697+
// Map next episode to air (non-zero ID means data is present)
698+
var nextEpisode *model.NextEpisode
699+
if tmdbDetails.NextEpisodeToAir.ID != 0 {
700+
nextEpisode = &model.NextEpisode{
701+
SeasonNumber: tmdbDetails.NextEpisodeToAir.SeasonNumber,
702+
EpisodeNumber: tmdbDetails.NextEpisodeToAir.EpisodeNumber,
703+
Title: tmdbDetails.NextEpisodeToAir.Name,
704+
AirDate: tmdbDetails.NextEpisodeToAir.AirDate,
705+
Overview: tmdbDetails.NextEpisodeToAir.Overview,
706+
StillPath: tmdbDetails.NextEpisodeToAir.StillPath,
707+
}
708+
}
709+
695710
return model.SeriesDetail{
696711
TmdbID: tmdbDetails.ID,
697712
Title: tmdbDetails.Name,
@@ -704,10 +719,13 @@ func (s *MediaService) GetSeriesDetail(ctx context.Context, tmdbID int64) (model
704719
InProduction: tmdbDetails.InProduction,
705720
Certification: certification,
706721
EpisodeRuntime: episodeRuntime,
722+
VoteAverage: float64(tmdbDetails.VoteAverage),
723+
VoteCount: int64(tmdbDetails.VoteCount),
707724
Genres: genres,
708-
PosterPath: tmdbDetails.PosterPath,
709-
BackdropPath: tmdbDetails.BackdropPath,
710-
Availability: availability,
725+
PosterPath: tmdbDetails.PosterPath,
726+
BackdropPath: tmdbDetails.BackdropPath,
727+
NextEpisodeToAir: nextEpisode,
728+
Availability: availability,
711729
Seasons: seasons,
712730
Credits: credits,
713731
Videos: videos,

docs/.vitepress/config.mts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import { defineConfig } from "vitepress";
22

33
// https://vitepress.dev/reference/site-config
44
export default defineConfig({
5+
head: [
6+
['link', { rel: 'icon', href: '/arrflix/favicon.svg' }],
7+
],
58
title: "Arrflix Docs",
69
description: "Self-hosted media management platform",
710
// https://vitepress.dev/guide/deploy#setting-a-public-base-path

docs/public/favicon.svg

Lines changed: 9 additions & 0 deletions
Loading

web/env.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,13 @@ declare module '*.vue' {
55
const component: DefineComponent<{}, {}, any>
66
export default component
77
}
8+
9+
export {}
10+
11+
declare module 'vue-router' {
12+
interface RouteMeta {
13+
public?: boolean
14+
layout?: 'immersive' | 'auth'
15+
setup?: boolean
16+
}
17+
}

web/public/favicon.ico

-4.19 KB
Binary file not shown.

web/public/favicon.svg

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)