mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-04-26 13:49:21 +08:00
minor fix: lyric_cn.go http response handling and popup.go searchpopup left border fix
This commit is contained in:
parent
5c616bdbd9
commit
39c0207637
@ -78,6 +78,10 @@ func (cn GetLyricCn) GetLyric(songTag *SongTag) (lyricString string, err error)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode != 200 {
|
||||
return "", fmt.Errorf("http response error: %d", resp.StatusCode)
|
||||
}
|
||||
|
||||
var tagLyric tagLyric
|
||||
err = json.NewDecoder(resp.Body).Decode(&tagLyric)
|
||||
if err != nil {
|
||||
@ -109,6 +113,10 @@ func getLyricOptionsCnByProvider(search string, serviceProvider string) (resultT
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode != 200 {
|
||||
return nil, fmt.Errorf("http response error: %d", resp.StatusCode)
|
||||
}
|
||||
|
||||
switch serviceProvider {
|
||||
case "kugou":
|
||||
var tagKugou []tagKugou
|
||||
|
5
popup.go
5
popup.go
@ -510,7 +510,10 @@ func searchPopup(title string, stringsToMatch []string, handler func(selected st
|
||||
|
||||
popup.Box = popupBox
|
||||
|
||||
gomu.pages.AddPage("search-input-popup", center(popup, 70, 40), true, true)
|
||||
// this is to fix the left border of search popup
|
||||
popupFrame := tview.NewFrame(popup)
|
||||
|
||||
gomu.pages.AddPage("search-input-popup", center(popupFrame, 70, 40), true, true)
|
||||
gomu.popups.push(popup)
|
||||
// This is to ensure the popup is shown even when paused
|
||||
gomu.app.Draw()
|
||||
|
Loading…
x
Reference in New Issue
Block a user