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{
|
||||
URL: primary.URL,
|
||||
Referer: primary.Referer,
|
||||
Type: primary.Type,
|
||||
}
|
||||
|
||||
for _, sub := range primary.Subtitles {
|
||||
|
||||
@@ -49,6 +49,7 @@ type SubtitleItem struct {
|
||||
|
||||
type ModeSource struct {
|
||||
Token string `json:"token"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Subtitles []SubtitleItem `json:"subtitles"`
|
||||
Qualities []string `json:"qualities,omitempty"`
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ type StreamSource struct {
|
||||
type StreamResult struct {
|
||||
URL string
|
||||
Referer string
|
||||
Type string
|
||||
Subtitles []Subtitle
|
||||
Qualities []StreamSource
|
||||
}
|
||||
|
||||
@@ -173,6 +173,7 @@ func (s *playbackService) buildModeSource(res *domain.StreamResult) domain.ModeS
|
||||
streamToken, _ := s.SignProxyToken(res.URL, res.Referer, "stream")
|
||||
return domain.ModeSource{
|
||||
Token: streamToken,
|
||||
Type: res.Type,
|
||||
Subtitles: subtitles,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user