Skip to content

Commit

Permalink
Fix #23 / #25
Browse files Browse the repository at this point in the history
  • Loading branch information
xypwn committed Dec 20, 2024
1 parent 182bf80 commit 1ee2bc0
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions pkg/southpark/infoextract.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ type websiteDataProps struct {
Image struct {
URL string `json:"url"`
} `json:"image"`
Duration string `json:"duration"`
LockedLabel string `json:"lockedLabel"`
} `json:"media"`
Meta struct {
Expand All @@ -219,6 +220,7 @@ type websiteDataProps struct {
Image struct {
URL string `json:"url"`
} `json:"image"`
Duration string `json:"duration"`
LockedLabel string `json:"lockedLabel"`
Video struct {
Config struct {
Expand Down Expand Up @@ -476,10 +478,11 @@ func GetEpisodes(ctx context.Context, season Season) (episodes []Episode, season
}
res = append(res, Episode{
EpisodeMetadata: EpisodeMetadata{
SeasonNumber: seasonNum,
EpisodeNumber: episodeNum,
Language: season.Language,
Unavailable: v.Media.LockedLabel != "",
SeasonNumber: seasonNum,
EpisodeNumber: episodeNum,
Language: season.Language,
Unavailable: v.Media.LockedLabel != "" ||
v.Media.Duration == "00:00",
RawThumbnailURL: v.Media.Image.URL,
Title: v.Meta.SubHeader,
Description: v.Meta.Description,
Expand Down Expand Up @@ -518,10 +521,12 @@ func GetEpisode(ctx context.Context, regionInfo RegionInfo, url string) (Episode

return Episode{
EpisodeMetadata: EpisodeMetadata{
SeasonNumber: seasonNum,
EpisodeNumber: episodeNum,
Language: language,
Unavailable: props.Media.UnavailableSlate.Title != "",
SeasonNumber: seasonNum,
EpisodeNumber: episodeNum,
Language: language,
Unavailable: props.Media.UnavailableSlate.Title != "" ||
props.Media.LockedLabel != "" ||
props.Media.Duration == "00:00",
RawThumbnailURL: props.Media.Image.URL,
Title: props.Media.Video.Config.Title,
Description: props.Meta.Description,
Expand All @@ -538,6 +543,7 @@ type searchData struct {
Image struct {
URL string `json:"url"`
} `json:"image"`
Duration string `json:"duration"`
LockedLabel string `json:"lockedLabel"`
} `json:"media"`
Meta struct {
Expand Down Expand Up @@ -599,10 +605,11 @@ func Search(
return nil, fmt.Errorf("get search result language: %w", err)
}
res = append(res, EpisodeMetadata{
SeasonNumber: seasonNum,
EpisodeNumber: episodeNum,
Language: urlLang,
Unavailable: v.Media.LockedLabel != "",
SeasonNumber: seasonNum,
EpisodeNumber: episodeNum,
Language: urlLang,
Unavailable: v.Media.LockedLabel != "" ||
v.Media.Duration == "00:00",
RawThumbnailURL: "https:" + v.Media.Image.URL,
Title: v.Meta.SubHeader,
Description: v.Meta.Description,
Expand Down

0 comments on commit 1ee2bc0

Please sign in to comment.