hot fix for file view metrics on web

This commit is contained in:
Sean Yesmunt 2019-04-14 23:57:09 -04:00
parent 7c4578edfe
commit ab3502bacc

View file

@ -2,6 +2,7 @@
import type { Claim } from 'types/claim';
import React, { Suspense } from 'react';
import { stopContextMenu } from 'util/context-menu';
import analytics from 'analytics';
import(/* webpackChunkName: "videojs" */
/* webpackPreload: true */
'video.js/dist/video-js.css');
@ -22,6 +23,11 @@ class AudioVideoViewer extends React.PureComponent<Props> {
componentDidMount() {
const { contentType, poster, claim } = this.props;
const { name, claim_id: claimId, txid, nout } = claim;
// Quick fix to get file view events on lbry.tv
// Will need to be changed to include time to start
analytics.apiLogView(`${name}#${claimId}`, `${txid}:${nout}`, claimId);
const path = `https://api.piratebay.com/content/claims/${claim.name}/${
claim.claim_id