purchase_uri for free content

This commit is contained in:
Akinwale Ariwodola 2020-05-14 03:43:08 +01:00
parent 6bed7bfd2f
commit aad718c714

View file

@ -944,6 +944,9 @@ public class FileViewActivity extends AppCompatActivity {
public void onClick(DialogInterface dialogInterface, int i) { public void onClick(DialogInterface dialogInterface, int i) {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString("uri", currentUrl); bundle.putString("uri", currentUrl);
bundle.putBoolean("paid", true);
bundle.putDouble("amount", cost);
bundle.putString("currency", fee.getCurrency());
LbryAnalytics.logEvent(LbryAnalytics.EVENT_PURCHASE_URI, bundle); LbryAnalytics.logEvent(LbryAnalytics.EVENT_PURCHASE_URI, bundle);
findViewById(R.id.file_view_main_action_button).setVisibility(View.INVISIBLE); findViewById(R.id.file_view_main_action_button).setVisibility(View.INVISIBLE);
@ -989,6 +992,13 @@ public class FileViewActivity extends AppCompatActivity {
public void onSuccess(LbryFile file, boolean saveFile) { public void onSuccess(LbryFile file, boolean saveFile) {
// queue the download // queue the download
if (claim != null) { if (claim != null) {
if (claim.isFree()) {
// paid is handled differently
Bundle bundle = new Bundle();
bundle.putString("uri", currentUrl);
LbryAnalytics.logEvent(LbryAnalytics.EVENT_PURCHASE_URI, bundle);
}
if (!claim.isPlayable()) { if (!claim.isPlayable()) {
logFileView(claim.getPermanentUrl(), 0); logFileView(claim.getPermanentUrl(), 0);
} }