mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-25 11:03:56 +00:00
Report on broken config when downloading Libretro cores
This commit is contained in:
parent
afb76aa970
commit
e8cec39476
2 changed files with 14 additions and 3 deletions
|
|
@ -60,6 +60,7 @@ type LibretroCoreConfig struct {
|
|||
}
|
||||
|
||||
type CoreInfo struct {
|
||||
Id string
|
||||
Name string
|
||||
AltRepo bool
|
||||
}
|
||||
|
|
@ -101,8 +102,8 @@ func (e Emulator) GetSupportedExtensions() []string {
|
|||
}
|
||||
|
||||
func (l *LibretroConfig) GetCores() (cores []CoreInfo) {
|
||||
for _, core := range l.Cores.List {
|
||||
cores = append(cores, CoreInfo{Name: core.Lib, AltRepo: core.AltRepo})
|
||||
for k, core := range l.Cores.List {
|
||||
cores = append(cores, CoreInfo{Id: k, Name: core.Lib, AltRepo: core.AltRepo})
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,14 +116,24 @@ func (m *Manager) download(cores []config.CoreInfo) (failed []string) {
|
|||
if len(cores) == 0 || m.repo == nil {
|
||||
return
|
||||
}
|
||||
var prime, second []string
|
||||
var prime, second, fail []string
|
||||
for _, n := range cores {
|
||||
if n.Name == "" {
|
||||
fail = append(fail, n.Id)
|
||||
continue
|
||||
}
|
||||
if !n.AltRepo {
|
||||
prime = append(prime, n.Name)
|
||||
} else {
|
||||
second = append(second, n.Name)
|
||||
}
|
||||
}
|
||||
|
||||
if len(prime) == 0 && len(second) == 0 {
|
||||
m.log.Warn().Msgf("[core-dl] couldn't find info for %v cores, check the config", fail)
|
||||
return
|
||||
}
|
||||
|
||||
m.log.Info().Msgf("[core-dl] <<< download | main: %v | alt: %v", prime, second)
|
||||
primeFails := m.down(prime, m.repo)
|
||||
if len(primeFails) > 0 && m.altRepo != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue