Skip to content

Commit

Permalink
Removed encoding check for non-video assets (#4899)
Browse files Browse the repository at this point in the history
  • Loading branch information
attemka authored Sep 20, 2023
1 parent 6f96219 commit bb2f469
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
15 changes: 12 additions & 3 deletions packages/atlas/src/hooks/useGetAssetUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,19 @@ export const getSingleAssetUrl = async (
return distributionAssetUrl
} catch (err) {
if (err instanceof MediaError) {
const codec = getVideoCodec(distributionAssetUrl)
UserEventsLogger.logWrongCodecEvent(eventEntry, { codec })
let codec = ''
if (type === 'video') {
codec = getVideoCodec(distributionAssetUrl)
}
UserEventsLogger.logWrongCodecEvent(eventEntry, { assetType: type, ...(type === 'video' ? { codec } : {}) })
SentryLogger.error('Error during asset download test, media is not supported', 'AssetsManager', err, {
asset: { parent, distributionAssetUrl, mediaError: err, codec },
asset: {
parent,
distributionAssetUrl,
mediaError: err,
assetType: type,
...(type === 'video' ? { codec } : {}),
},
})
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/atlas/src/utils/logs/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export type DistributorEventEntry = {
} & DistributorEventDetails

type CodecInfo = {
assetType: string | null
codec?: string
}

Expand Down

0 comments on commit bb2f469

Please sign in to comment.