feat: propagate stream source type from provider to client
This commit is contained in:
@@ -60,6 +60,7 @@ func (c *AllAnimeProvider) GetStreams(ctx context.Context, animeID int, titleCan
|
|||||||
result := &domain.StreamResult{
|
result := &domain.StreamResult{
|
||||||
URL: primary.URL,
|
URL: primary.URL,
|
||||||
Referer: primary.Referer,
|
Referer: primary.Referer,
|
||||||
|
Type: primary.Type,
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, sub := range primary.Subtitles {
|
for _, sub := range primary.Subtitles {
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ type SubtitleItem struct {
|
|||||||
|
|
||||||
type ModeSource struct {
|
type ModeSource struct {
|
||||||
Token string `json:"token"`
|
Token string `json:"token"`
|
||||||
|
Type string `json:"type,omitempty"`
|
||||||
Subtitles []SubtitleItem `json:"subtitles"`
|
Subtitles []SubtitleItem `json:"subtitles"`
|
||||||
Qualities []string `json:"qualities,omitempty"`
|
Qualities []string `json:"qualities,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ type StreamSource struct {
|
|||||||
type StreamResult struct {
|
type StreamResult struct {
|
||||||
URL string
|
URL string
|
||||||
Referer string
|
Referer string
|
||||||
|
Type string
|
||||||
Subtitles []Subtitle
|
Subtitles []Subtitle
|
||||||
Qualities []StreamSource
|
Qualities []StreamSource
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ func (s *playbackService) buildModeSource(res *domain.StreamResult) domain.ModeS
|
|||||||
streamToken, _ := s.SignProxyToken(res.URL, res.Referer, "stream")
|
streamToken, _ := s.SignProxyToken(res.URL, res.Referer, "stream")
|
||||||
return domain.ModeSource{
|
return domain.ModeSource{
|
||||||
Token: streamToken,
|
Token: streamToken,
|
||||||
|
Type: res.Type,
|
||||||
Subtitles: subtitles,
|
Subtitles: subtitles,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user