Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.

Commit

Permalink
api/test: Fixed issues with api tests. Fixes #13
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyah Check committed Sep 17, 2017
1 parent 42207c6 commit b3cc116
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestApi(t *testing.T) {
t.Errorf("APIGetVideoStream(%d): expected %v, actual %v", i, nil, err)
}

file := path + rawVideo.Title + rawVideo.Author
file := path + table.url + ".mp3"
err = APIConvertVideo(file, 123, ID, video)
if err != nil {
t.Errorf("APIConvertVideo(%d): expected %v, actual %v", i, nil, err)
Expand Down
12 changes: 6 additions & 6 deletions api/apidata.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,18 @@ func APIGetVideoStream(id string, video *RawVideoData) (videoData []string, err
}

data := map[string]string{
"quality": dec_data["quality"][0],
"type": dec_data["type"][0],
"url": dec_data["url"][0],
"sig": dec_data["sig"][0],
"quality": dec_data.Get("quality"),
"type": dec_data.Get("type"),
"url": dec_data.Get("url"),
"sig": dec_data.Get("sig"),
"title": video.Title,
"author": video.Author,
"format": dec_data["format"][0],
"format": dec_data.Get("format"),
}

str, _ := json.Marshal(data)
decodedVideo = append(decodedVideo, string(str))
logrus.Infof("\nDecoded %d bytes of %q, in %q format", len(decodedVideo), dec_data["quality"][0], dec_data["format"][0])
logrus.Infof("\nDecoded %d bytes of %q, in %q format", len(decodedVideo), dec_data.Get("quality"), dec_data.Get("format"))
}

return decodedVideo, nil
Expand Down

0 comments on commit b3cc116

Please sign in to comment.