mirror of
https://gitlab.com/foxixus/neomovies-api.git
synced 2025-10-27 17:38:51 +05:00
Compare commits
2 Commits
47bcc6589d
...
53a405a743
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53a405a743 | ||
|
|
71ea922528 |
@@ -75,6 +75,7 @@ type UnifiedSearchItem struct {
|
|||||||
SourceID string `json:"sourceId"`
|
SourceID string `json:"sourceId"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
|
OriginalType string `json:"originalType,omitempty"`
|
||||||
ReleaseDate string `json:"releaseDate"`
|
ReleaseDate string `json:"releaseDate"`
|
||||||
PosterURL string `json:"posterUrl"`
|
PosterURL string `json:"posterUrl"`
|
||||||
Rating float64 `json:"rating"`
|
Rating float64 `json:"rating"`
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
package services
|
package services
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"neomovies-api/pkg/models"
|
"neomovies-api/pkg/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
func MapKPFilmToTMDBMovie(kpFilm *KPFilm) *models.Movie {
|
func MapKPFilmToTMDBMovie(kpFilm *KPFilm) *models.Movie {
|
||||||
@@ -220,8 +220,8 @@ func MapKPToUnified(kpFilm *KPFilm) *models.UnifiedContent {
|
|||||||
Type: mapKPTypeToUnified(kpFilm),
|
Type: mapKPTypeToUnified(kpFilm),
|
||||||
Genres: genres,
|
Genres: genres,
|
||||||
Rating: kpFilm.RatingKinopoisk,
|
Rating: kpFilm.RatingKinopoisk,
|
||||||
PosterURL: poster,
|
PosterURL: BuildAPIImageProxyURL(poster, "w500"),
|
||||||
BackdropURL: kpFilm.CoverUrl,
|
BackdropURL: BuildAPIImageProxyURL(kpFilm.CoverUrl, "w1280"),
|
||||||
Director: "",
|
Director: "",
|
||||||
Cast: []models.UnifiedCastMember{},
|
Cast: []models.UnifiedCastMember{},
|
||||||
Duration: kpFilm.FilmLength,
|
Duration: kpFilm.FilmLength,
|
||||||
|
|||||||
@@ -236,6 +236,7 @@ func MapKPSearchToUnifiedItems(kps *KPSearchResponse) []models.UnifiedSearchItem
|
|||||||
SourceID: "kp_" + strconv.Itoa(kpId),
|
SourceID: "kp_" + strconv.Itoa(kpId),
|
||||||
Title: title,
|
Title: title,
|
||||||
Type: mapKPTypeToUnifiedShort(f.Type),
|
Type: mapKPTypeToUnifiedShort(f.Type),
|
||||||
|
OriginalType: strings.ToUpper(strings.TrimSpace(f.Type)),
|
||||||
ReleaseDate: yearToDate(f.Year),
|
ReleaseDate: yearToDate(f.Year),
|
||||||
PosterURL: poster,
|
PosterURL: poster,
|
||||||
Rating: rating,
|
Rating: rating,
|
||||||
|
|||||||
Reference in New Issue
Block a user