Files
AynaLivePlayer/internal/source/source.go
Aynakeya 5cc5948a85 Merge 1.0.x branch (#8)
* rewrite

* update submodule

* make width height configurable

* update dependency

* update

* update file

* update dep

* fix basic config layout

* update plugin management

* more stuff

* add blacklist

* fix todo

* fix windows gethandle

* update windows update guide

* update windows build guide

* include go mod tidy in script

* update todo

* fix source session

* fix text output

* add plugin play duration control

* fix id diange not working

* update todo

* update version number
2024-04-22 21:21:02 -07:00

42 lines
950 B
Go

package source
import (
"AynaLivePlayer/core/events"
"AynaLivePlayer/global"
"AynaLivePlayer/pkg/config"
"github.com/AynaLivePlayer/miaosic"
//_ "github.com/AynaLivePlayer/miaosic/providers/bilibili"
_ "github.com/AynaLivePlayer/miaosic/providers/bilivideo"
_ "github.com/AynaLivePlayer/miaosic/providers/kuwo"
"github.com/AynaLivePlayer/miaosic/providers/local"
_ "github.com/AynaLivePlayer/miaosic/providers/netease"
)
type _sourceConfig struct {
LocalSourcePath string
}
func (_ _sourceConfig) Name() string {
return "Source"
}
func (_ _sourceConfig) OnLoad() {
}
func (_ _sourceConfig) OnSave() {
}
var sourceCfg = &_sourceConfig{
LocalSourcePath: "./music",
}
func Initialize() {
config.LoadConfig(sourceCfg)
miaosic.RegisterProvider(local.NewLocal(sourceCfg.LocalSourcePath))
global.EventManager.CallA(
events.MediaProviderUpdate, events.MediaProviderUpdateEvent{
Providers: miaosic.ListAvailableProviders(),
})
}