MCPcopy Create free account
hub / github.com/LumePart/Explo / GetLibrary

Method GetLibrary

src/client/emby.go:76–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74}
75
76func (c *Emby) GetLibrary() error {
77 reqParam := "/emby/Library/VirtualFolders"
78
79 body, err := c.HttpClient.MakeRequest("GET", c.Cfg.URL+reqParam, nil, c.Cfg.Creds.Headers)
80 if err != nil {
81 return err
82 }
83
84 var paths EmbyPaths
85 if err = util.ParseResp(body, &paths); err != nil {
86 return err
87 }
88 for _, path := range paths {
89 if path.Name == c.Cfg.LibraryName {
90 c.LibraryID = path.ItemID
91 return nil
92 }
93 }
94
95 return fmt.Errorf("failed to find library named %s", c.Cfg.LibraryName)
96}
97
98func (c *Emby) AddLibrary() error {
99 reqParam := "/emby/Library/VirtualFolders"

Callers

nothing calls this directly

Calls 2

ParseRespFunction · 0.92
MakeRequestMethod · 0.80

Tested by

no test coverage detected