diff --git a/mlp/mlp.go b/mlp/mlp.go index 8c535ea..d3ab50b 100644 --- a/mlp/mlp.go +++ b/mlp/mlp.go @@ -41,3 +41,18 @@ const ( BlockOdyssey BlockID = "EO" // Odyssey block - EO/HM/MT BlockDefenders BlockID = "DE" // Defenders block - DE/SB/FF ) + +var allSets = []SetID{ + SetPremiere, + SetCanterlotNights, + SetRockNRave, + SetCelestialSolstice, + SetCrystalGames, + SetAbsoluteDiscord, + SetEquestrialOdysseys, + SetHighMagic, + SetMarksInTime, + SetDefendersOfEquestria, + SetSeaquestriaBeyond, + SetFriendsForever, +} diff --git a/mlp/set.go b/mlp/set.go index b6e56dc..483e82c 100644 --- a/mlp/set.go +++ b/mlp/set.go @@ -120,3 +120,14 @@ func LoadSetHTTP(id SetID) (*Set, error) { return LoadSetBytes(id, data) } + +// LoadAllSets just loads all sets from the web +func LoadAllSets() error { + for _, set := range allSets { + _, err := LoadSetHTTP(set) + if err != nil { + return err + } + } + return nil +} diff --git a/mlp/set_test.go b/mlp/set_test.go index 179a095..3529409 100644 --- a/mlp/set_test.go +++ b/mlp/set_test.go @@ -75,6 +75,12 @@ func TestAllLoads(t *testing.T) { if err != nil { t.Fatalf("[LoadSetMemory] Could not load set: %s", err.Error()) } + + // Load all remaining sets + err = mlp.LoadAllSets() + if err != nil { + t.Fatalf("[LoadAllSets] Could not load remaining sets: %s", err.Error()) + } } // TestNotLoadedErr tests that LoadSetMemory fails if set is not cached