Skip to content

Commit 0d72d59

Browse files
committed
TEMP-DISABLED: Comment out FlixHQ, SFlix, and NineAnime sources and related functionality until fixes are implemented. This includes disabling provider registrations, API calls, and associated tests. Preserve original code in comments for future restoration. Adjusted episode filtering logic in SuperFlix to ensure correct air date handling, with added regression tests to validate behavior across time zones.
1 parent 39317fe commit 0d72d59

9 files changed

Lines changed: 500 additions & 353 deletions

File tree

internal/api/enhanced.go

Lines changed: 271 additions & 233 deletions
Large diffs are not rendered by default.

internal/api/providers/source_providers.go

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,20 @@ func (p *goyabuProvider) FetchStreamURL(_ context.Context, episode *models.Episo
136136
}
137137

138138
// --- FlixHQ Provider ---
139-
140-
type flixHQProvider struct {
141-
sm *scraper.ScraperManager
142-
}
143-
139+
//
140+
// TEMP-DISABLED: entire FlixHQ provider commented out until a fix lands.
141+
// Restore the init() and the type+methods together.
142+
/*
144143
func init() {
145144
RegisterProvider(source.FlixHQ, func(sm *scraper.ScraperManager) Provider {
146145
return &flixHQProvider{sm: sm}
147146
})
148147
}
149148
149+
type flixHQProvider struct {
150+
sm *scraper.ScraperManager
151+
}
152+
150153
func (p *flixHQProvider) Kind() source.SourceKind { return source.FlixHQ }
151154
func (p *flixHQProvider) HasSeasons() bool { return true }
152155
@@ -172,19 +175,23 @@ func (p *flixHQProvider) FetchStreamURL(_ context.Context, episode *models.Episo
172175
}
173176
return url, nil
174177
}
178+
*/
175179

176180
// --- SFlix Provider ---
177-
178-
type sflixProvider struct {
179-
sm *scraper.ScraperManager
180-
}
181-
181+
//
182+
// TEMP-DISABLED: entire SFlix provider commented out until a fix lands.
183+
// Restore the init() and the type+methods together.
184+
/*
182185
func init() {
183186
RegisterProvider(source.SFlix, func(sm *scraper.ScraperManager) Provider {
184187
return &sflixProvider{sm: sm}
185188
})
186189
}
187190
191+
type sflixProvider struct {
192+
sm *scraper.ScraperManager
193+
}
194+
188195
func (p *sflixProvider) Kind() source.SourceKind { return source.SFlix }
189196
func (p *sflixProvider) HasSeasons() bool { return true }
190197
@@ -210,19 +217,23 @@ func (p *sflixProvider) FetchStreamURL(_ context.Context, episode *models.Episod
210217
}
211218
return url, nil
212219
}
220+
*/
213221

214222
// --- NineAnime Provider ---
215-
216-
type nineAnimeProvider struct {
217-
sm *scraper.ScraperManager
218-
}
219-
223+
//
224+
// TEMP-DISABLED: entire NineAnime provider commented out until a fix lands.
225+
// Restore the init() and the type+methods together.
226+
/*
220227
func init() {
221228
RegisterProvider(source.NineAnime, func(sm *scraper.ScraperManager) Provider {
222229
return &nineAnimeProvider{sm: sm}
223230
})
224231
}
225232
233+
type nineAnimeProvider struct {
234+
sm *scraper.ScraperManager
235+
}
236+
226237
func (p *nineAnimeProvider) Kind() source.SourceKind { return source.NineAnime }
227238
func (p *nineAnimeProvider) HasSeasons() bool { return false }
228239
@@ -245,6 +256,7 @@ func (p *nineAnimeProvider) FetchStreamURL(_ context.Context, episode *models.Ep
245256
}
246257
return url, nil
247258
}
259+
*/
248260

249261
// --- SuperFlix Provider ---
250262

internal/api/source/definition.go

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,26 @@ var sourceDefs = []SourceDefinition{
4747
Tags: []string{"[superflix]"},
4848
URLMatchers: []string{"superflix"},
4949
},
50-
{
51-
Kind: FlixHQ,
52-
Explicit: []string{"FlixHQ"},
53-
Tags: []string{"[flixhq]", "[movie]", "[tv]"},
54-
URLMatchers: []string{"flixhq"},
55-
MediaTypes: []models.MediaType{models.MediaTypeMovie, models.MediaTypeTV},
56-
},
57-
{
58-
Kind: SFlix,
59-
Explicit: []string{"SFlix"},
60-
Tags: []string{"[sflix]"},
61-
URLMatchers: []string{"sflix"},
62-
},
63-
{
64-
Kind: NineAnime,
65-
Explicit: []string{"9Anime"},
66-
Tags: []string{"[9anime]", "[multilanguage]"},
67-
URLMatchers: []string{"9anime"},
68-
},
50+
// TEMP-DISABLED: FlixHQ, SFlix, and 9Anime source defs commented out until a fix lands.
51+
// {
52+
// Kind: FlixHQ,
53+
// Explicit: []string{"FlixHQ"},
54+
// Tags: []string{"[flixhq]", "[movie]", "[tv]"},
55+
// URLMatchers: []string{"flixhq"},
56+
// MediaTypes: []models.MediaType{models.MediaTypeMovie, models.MediaTypeTV},
57+
// },
58+
// {
59+
// Kind: SFlix,
60+
// Explicit: []string{"SFlix"},
61+
// Tags: []string{"[sflix]"},
62+
// URLMatchers: []string{"sflix"},
63+
// },
64+
// {
65+
// Kind: NineAnime,
66+
// Explicit: []string{"9Anime"},
67+
// Tags: []string{"[9anime]", "[multilanguage]"},
68+
// URLMatchers: []string{"9anime"},
69+
// },
6970
{
7071
Kind: AllAnime,
7172
Explicit: []string{"AllAnime"},

internal/api/source/resolve_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ import (
66
"github.com/alvarorichard/Goanime/internal/models"
77
)
88

9+
// skipIfTempDisabled skips a sub-test whose expected kind is one of the
10+
// providers temporarily disabled in definition.go. Restore the call sites
11+
// (or remove this helper) when those sourceDefs entries are re-enabled.
12+
func skipIfTempDisabled(t *testing.T, kind SourceKind) {
13+
t.Helper()
14+
switch kind {
15+
case FlixHQ, SFlix, NineAnime:
16+
t.Skipf("TEMP-DISABLED: %s source is commented out in sourceDefs", kind)
17+
}
18+
}
19+
920
func TestResolve_ExplicitSource(t *testing.T) {
1021
tests := []struct {
1122
name string
@@ -24,6 +35,7 @@ func TestResolve_ExplicitSource(t *testing.T) {
2435
}
2536
for _, tt := range tests {
2637
t.Run(tt.name, func(t *testing.T) {
38+
skipIfTempDisabled(t, tt.wantKind)
2739
anime := &models.Anime{Source: tt.source}
2840
got := Resolve(anime)
2941
if got.Kind != tt.wantKind {
@@ -34,6 +46,7 @@ func TestResolve_ExplicitSource(t *testing.T) {
3446
}
3547

3648
func TestResolve_ExplicitSourceTrumpsURL(t *testing.T) {
49+
skipIfTempDisabled(t, NineAnime)
3750
anime := &models.Anime{
3851
Source: "9Anime",
3952
URL: "https://animefire.plus/something",
@@ -55,6 +68,7 @@ func TestResolve_MediaType(t *testing.T) {
5568
}
5669
for _, tt := range tests {
5770
t.Run(tt.name, func(t *testing.T) {
71+
skipIfTempDisabled(t, tt.wantKind)
5872
anime := &models.Anime{MediaType: tt.mediaType}
5973
got := Resolve(anime)
6074
if got.Kind != tt.wantKind {
@@ -84,6 +98,7 @@ func TestResolve_NameTags(t *testing.T) {
8498
}
8599
for _, tt := range tests {
86100
t.Run(tt.name, func(t *testing.T) {
101+
skipIfTempDisabled(t, tt.wantKind)
87102
anime := &models.Anime{Name: tt.animName}
88103
got := Resolve(anime)
89104
if got.Kind != tt.wantKind {
@@ -110,6 +125,7 @@ func TestResolve_URLPatterns(t *testing.T) {
110125
}
111126
for _, tt := range tests {
112127
t.Run(tt.name, func(t *testing.T) {
128+
skipIfTempDisabled(t, tt.wantKind)
113129
anime := &models.Anime{URL: tt.url}
114130
got := Resolve(anime)
115131
if got.Kind != tt.wantKind {

internal/scraper/flixhq_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ func TestFlixHQClient_ExtractLanguageFromLabel(t *testing.T) {
151151
}
152152

153153
func TestMediaManager_Creation(t *testing.T) {
154+
t.Skip("TEMP-DISABLED: FlixHQ adapter is not registered in NewScraperManager while the source is disabled")
155+
154156
mm := NewMediaManager()
155157

156158
if mm.scraperManager == nil {

0 commit comments

Comments
 (0)