Skip to content

Commit

Permalink
add isShort field to video entity
Browse files Browse the repository at this point in the history
  • Loading branch information
zeeshanakram3 committed Feb 21, 2024
1 parent 52333e9 commit 7a470cc
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 36 deletions.
44 changes: 22 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@joystream/types": "0.20.5"
},
"dependencies": {
"@joystream/js": "^1.4.0",
"@joystream/js": "^1.8.0",
"@openapitools/openapi-generator-cli": "^2.5.2",
"@opentelemetry/api": "^1.4.1",
"@opentelemetry/auto-instrumentations-node": "0.37.0",
Expand Down
3 changes: 3 additions & 0 deletions schema/videos.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ type Video @entity @schema(name: "admin") {

"Video relevance score based on the views, reactions, comments and update date"
videoRelevance: Float! @index

"Whether the video is a short format, vertical video (e.g. Youtube Shorts, TikTok, Instagram Reels)"
isShort: Boolean
}

type VideoFeaturedInCategory
Expand Down
27 changes: 14 additions & 13 deletions src/mappings/content/metadata.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import {
BanOrUnbanMemberFromChannel,
ChannelMetadata,
ChannelModeratorRemarked,
ChannelOwnerRemarked,
IBanOrUnbanMemberFromChannel,
IChannelMetadata,
IChannelModeratorRemarked,
IChannelOwnerRemarked,
ILicense,
IMakeChannelPayment,
IMediaType,
IModerateComment,
IPinOrUnpinComment,
IPublishedBeforeJoystream,
ISubtitleMetadata,
IVideoMetadata,
IVideoReactionsPreference,
MakeChannelPayment,
ModerateComment,
PinOrUnpinComment,
PublishedBeforeJoystream,
SubtitleMetadata,
VideoMetadata,
VideoReactionsPreference,
IBanOrUnbanMemberFromChannel,
BanOrUnbanMemberFromChannel,
IMakeChannelPayment,
MakeChannelPayment,
} from '@joystream/metadata-protobuf'
import { AnyMetadataClass, DecodedMetadataObject } from '@joystream/metadata-protobuf/types'
import {
Expand All @@ -31,14 +31,19 @@ import {
isSet,
isValidLanguageCode,
} from '@joystream/metadata-protobuf/utils'
import { assertNotNull, SubstrateBlock } from '@subsquid/substrate-processor'
import { SubstrateBlock, assertNotNull } from '@subsquid/substrate-processor'
import {
BannedMember,
Channel,
ChannelPaymentMadeEventData,
ChannelRecipient,
Comment,
CommentStatus,
DirectChannelPaymentByMember,
Event,
License,
MemberBannedFromChannelEventData,
Membership,
MetaprotocolTransactionResult,
MetaprotocolTransactionResultChannelPaid,
MetaprotocolTransactionResultCommentModerated,
Expand All @@ -53,12 +58,8 @@ import {
VideoMediaEncoding,
VideoMediaMetadata,
VideoSubtitle,
MemberBannedFromChannelEventData,
Membership,
Event,
DirectChannelPaymentByMember,
ChannelRecipient,
} from '../../model'
import { addNotification } from '../../utils/notification'
import { EntityManagerOverlay, Flat } from '../../utils/overlay'
import {
commentCountersManager,
Expand All @@ -67,14 +68,13 @@ import {
metaprotocolTransactionFailure,
} from '../utils'
import {
AsDecoded,
ASSETS_MAP,
AsDecoded,
EntityAssetProps,
EntityAssetsMap,
getChannelOwnerAccount,
MetaNumberProps,
getChannelOwnerAccount,
} from './utils'
import { addNotification } from '../../utils/notification'

export async function processChannelMetadata(
overlay: EntityManagerOverlay,
Expand Down Expand Up @@ -118,6 +118,7 @@ export async function processVideoMetadata(
'hasMarketing',
'isExplicit',
'isPublic',
'isShort'
])

await processAssets(overlay, block, assets, video, VideoMetadata, meta, ASSETS_MAP.video)
Expand Down

0 comments on commit 7a470cc

Please sign in to comment.