Skip to content

Commit ad6d645

Browse files
fix: movie playback issue for sflix and flixhq
1 parent 2d00e2f commit ad6d645

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

internal/providers/movies/flixhq/flixhq.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,3 +780,19 @@ func (f *FlixHQ) GetAvailableQualities(ctx context.Context, episodeID string) ([
780780
func (f *FlixHQ) HealthCheck(ctx context.Context) error {
781781
return nil
782782
}
783+
784+
// GetMovieEpisodeID retrieves the episode ID for a movie
785+
func (f *FlixHQ) GetMovieEpisodeID(ctx context.Context, mediaID string) (string, error) {
786+
info, err := f.GetInfo(mediaID)
787+
if err != nil {
788+
return "", err
789+
}
790+
movieInfo, ok := info.(*types.MovieInfo)
791+
if !ok {
792+
return "", fmt.Errorf("invalid info type")
793+
}
794+
if len(movieInfo.Episodes) > 0 {
795+
return movieInfo.Episodes[0].ID, nil
796+
}
797+
return "", fmt.Errorf("no episodes found for movie %s", mediaID)
798+
}

internal/providers/movies/sflix/sflix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ func (s *SFlix) extractSourcesFromServer(server types.EpisodeServer) (*types.Vid
822822
}
823823

824824
// GetMovieEpisodeID retrieves the episode ID for a movie
825-
func (s *SFlix) GetMovieEpisodeID(mediaID string) (string, error) {
825+
func (s *SFlix) GetMovieEpisodeID(ctx context.Context, mediaID string) (string, error) {
826826
info, err := s.GetInfo(mediaID)
827827
if err != nil {
828828
return "", err

0 commit comments

Comments
 (0)