mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2026-03-15 22:13:17 +08:00
save session when application close
This commit is contained in:
@@ -54,6 +54,17 @@ func (w *SourceLogin) Enable() error {
|
||||
}
|
||||
|
||||
func (w *SourceLogin) Disable() error {
|
||||
w.log.Info("save session for all provider")
|
||||
providers := miaosic.ListAvailableProviders()
|
||||
for _, pname := range providers {
|
||||
if p, ok := miaosic.GetProvider(pname); ok {
|
||||
pl, ok2 := p.(miaosic.Loginable)
|
||||
if ok2 {
|
||||
w.log.Info("save session for %s", pname)
|
||||
w.sessions[pname] = pl.SaveSession()
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user