Skip to content

Commit

Permalink
Replace v2 player api reference with v3
Browse files Browse the repository at this point in the history
  • Loading branch information
anbsky committed Jul 3, 2020
1 parent 4a3a535 commit 5f36b84
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions app/query/caller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ func TestCaller_Status(t *testing.T) {
}

func TestCaller_GetFreeUnauthenticated(t *testing.T) {
config.Override("BaseContentURL", "https://cdn.lbryplayer.xyz/api/v2/streams/")
config.Override("BaseContentURL", "https://cdn.lbryplayer.xyz/api/v3/streams/")
defer config.RestoreOverridden()

srvAddress := test.RandServerAddress(t)
Expand All @@ -534,11 +534,11 @@ func TestCaller_GetFreeUnauthenticated(t *testing.T) {
getResponse := &ljsonrpc.GetResponse{}
err = resp.GetObject(&getResponse)
require.NoError(t, err)
assert.Equal(t, "https://cdn.lbryplayer.xyz/api/v2/streams/free/what/19b9c243bea0c45175e6a6027911abbad53e983e/d51692", getResponse.StreamingURL)
assert.Equal(t, "https://cdn.lbryplayer.xyz/api/v3/streams/free/what/19b9c243bea0c45175e6a6027911abbad53e983e/d51692", getResponse.StreamingURL)
}

func TestCaller_GetFreeAuthenticated(t *testing.T) {
config.Override("BaseContentURL", "https://cdn.lbryplayer.xyz/api/v2/streams/")
config.Override("BaseContentURL", "https://cdn.lbryplayer.xyz/api/v3/streams/")
defer config.RestoreOverridden()

uri := "what"
Expand All @@ -557,11 +557,11 @@ func TestCaller_GetFreeAuthenticated(t *testing.T) {
getResponse := &ljsonrpc.GetResponse{}
err = resp.GetObject(&getResponse)
require.NoError(t, err)
assert.Equal(t, "https://cdn.lbryplayer.xyz/api/v2/streams/free/what/19b9c243bea0c45175e6a6027911abbad53e983e/d51692", getResponse.StreamingURL)
assert.Equal(t, "https://cdn.lbryplayer.xyz/api/v3/streams/free/what/19b9c243bea0c45175e6a6027911abbad53e983e/d51692", getResponse.StreamingURL)
}

func TestCaller_GetInvalidURLAuthenticated(t *testing.T) {
config.Override("BaseContentURL", "https://cdn.lbryplayer.xyz/api/v2/streams/")
config.Override("BaseContentURL", "https://cdn.lbryplayer.xyz/api/v3/streams/")
defer config.RestoreOverridden()

uri := "what#@1||||"
Expand Down Expand Up @@ -602,7 +602,7 @@ func TestCaller_GetPaidUnauthenticated(t *testing.T) {
}

func TestCaller_GetPaidPurchased(t *testing.T) {
config.Override("BaseContentURL", "https://cdn.lbryplayer.xyz/api/v2/streams/")
config.Override("BaseContentURL", "https://cdn.lbryplayer.xyz/api/v3/streams/")
defer config.RestoreOverridden()

uri := "Body-Language---Robert-F.-Kennedy-Assassination---Hypnosis#d66f8ba85c85ca48daba9183bd349307fe30cb43"
Expand Down Expand Up @@ -635,12 +635,12 @@ func TestCaller_GetPaidPurchased(t *testing.T) {
getResponse := &ljsonrpc.GetResponse{}
err = resp.GetObject(&getResponse)
require.NoError(t, err)
assert.Equal(t, "https://cdn.lbryplayer.xyz/api/v2/streams/paid/"+claimName+"/"+claimID+"/"+sdHash+"/"+token, getResponse.StreamingURL)
assert.Equal(t, "https://cdn.lbryplayer.xyz/api/v3/streams/paid/"+claimName+"/"+claimID+"/"+sdHash+"/"+token, getResponse.StreamingURL)
assert.NotNil(t, getResponse.PurchaseReceipt)
}

func TestCaller_GetPaidResolveLag(t *testing.T) {
config.Override("BaseContentURL", "https://cdn.lbryplayer.xyz/api/v2/streams/")
config.Override("BaseContentURL", "https://cdn.lbryplayer.xyz/api/v3/streams/")
defer config.RestoreOverridden()

uri := "Body-Language---Robert-F.-Kennedy-Assassination---Hypnosis#d66f8ba85c85ca48daba9183bd349307fe30cb43"
Expand All @@ -661,7 +661,7 @@ func TestCaller_GetPaidResolveLag(t *testing.T) {
}

func TestCaller_GetPaidPurchasedMissingPurchase(t *testing.T) {
config.Override("BaseContentURL", "https://cdn.lbryplayer.xyz/api/v2/streams/")
config.Override("BaseContentURL", "https://cdn.lbryplayer.xyz/api/v3/streams/")
defer config.RestoreOverridden()

uri := "Body-Language---Robert-F.-Kennedy-Assassination---Hypnosis#d66f8ba85c85ca48daba9183bd349307fe30cb43"
Expand Down Expand Up @@ -734,13 +734,13 @@ func TestCaller_GetPaidPurchasedMissingPurchase(t *testing.T) {
getResponse := &ljsonrpc.GetResponse{}
err = resp.GetObject(&getResponse)
require.NoError(t, err)
assert.Equal(t, "https://cdn.lbryplayer.xyz/api/v2/streams/paid/"+claimName+"/"+claimID+"/"+sdHash+"/"+token, getResponse.StreamingURL)
assert.Equal(t, "https://cdn.lbryplayer.xyz/api/v3/streams/paid/"+claimName+"/"+claimID+"/"+sdHash+"/"+token, getResponse.StreamingURL)
assert.NotNil(t, getResponse.PurchaseReceipt)
assert.EqualValues(t, "250.0", getResponse.PurchaseReceipt.(map[string]interface{})["amount"])
}

func TestCaller_GetPaidPurchasedMissingEverything(t *testing.T) {
config.Override("BaseContentURL", "https://cdn.lbryplayer.xyz/api/v2/streams/")
config.Override("BaseContentURL", "https://cdn.lbryplayer.xyz/api/v3/streams/")
defer config.RestoreOverridden()

uri := "Body-Language---Robert-F.-Kennedy-Assassination---Hypnosis#d66f8ba85c85ca48daba9183bd349307fe30cb43"
Expand Down
2 changes: 1 addition & 1 deletion lbrytv.production.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BaseContentURL: https://cdn.lbryplayer.xyz/api/v2/streams/
BaseContentURL: https://cdn.lbryplayer.xyz/api/v3/streams/
InternalAPIHost: https://api.lbry.com
ProjectURL: https://lbry.tv

Expand Down

0 comments on commit 5f36b84

Please sign in to comment.