diff --git a/lyric/lyric_cn.go b/lyric/lyric_cn.go index f4bffcd..6c8172b 100644 --- a/lyric/lyric_cn.go +++ b/lyric/lyric_cn.go @@ -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 diff --git a/popup.go b/popup.go index d8b197f..70d0396 100644 --- a/popup.go +++ b/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()