Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video NFT Support #3

Merged
merged 10 commits into from
Aug 30, 2021
Prev Previous commit
Next Next commit
Fix bug with null animation url in nft meta
  • Loading branch information
creativedrewy committed Aug 26, 2021
commit 30d9f4bc197f5c27758d8123e17084f9b62d853f
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ data class NftMetadata(
val symbol: String,
val description: String,
val image: String,
val animationUrl: String,
val animationUrl: String?,
val externalUrl: String,
val attributes: List<NftAttributes>?,
val properties: NftProperties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class NftSpecRepository(
private val gson: Gson = GsonBuilder()
.registerTypeAdapter(NftProperties::class.java, NftPropertiesDeserializer())
.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
.serializeNulls()
.create()
) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class GalleryViewStateMapping @Inject constructor() {
blockchain = chainDetails,
siteUrl = nft.externalUrl,
displayImageUrl = nft.image,
videoUrl = nft.animationUrl,
videoUrl = nft.animationUrl ?: "",
assetType = determineAssetType(nft),
assetUrl = findDownloadUri(nft.properties) ?: "",
attributes = attribs,
Expand All @@ -46,7 +46,7 @@ class GalleryViewStateMapping @Inject constructor() {
return when {
nft.properties.category == NftCategories.VR -> Model3d
nft.properties.category == NftCategories.Image
&& nft.animationUrl.endsWith(".mp4") -> ImageAndVideo
&& nft.animationUrl?.endsWith(".mp4") == true -> ImageAndVideo
else -> Image
}
}
Expand Down