Compare commits

..

No commits in common. "master" and "ivan/add-client-side-start-and-end-time" have entirely different histories.

8 changed files with 404 additions and 2328 deletions

View File

@ -7,7 +7,7 @@ readme = "README.md"
packages = [{include = "rbproto"}] packages = [{include = "rbproto"}]
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = ">=3.10,<=3.13" python = ">=3.10,<3.12"
protobuf = "^4.25.3" protobuf = "^4.25.3"

View File

@ -5,21 +5,3 @@ extend type ShotGQL {
startTime: Float! startTime: Float!
endTime: Float! endTime: Float!
} }
extend type UploadStreamGQL {
segmentEndFrames: [Int!]!
}
extend type HLSPlaylistGQL {
segmentStartTimes: [Float!]!
}
type SegmentEndFramesGQL {
id: Int!
segmentEndFrames: [Int!]!
}
type SegmentStartTimesGQL {
id: Int!
segmentStartTimes: [Float!]!
}

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,3 @@
# DO NOT USE: use getVideoFeed instead
query GetFeed( query GetFeed(
$limit: Int! = 5 $limit: Int! = 5
$after: String = null $after: String = null
@ -6,71 +5,31 @@ query GetFeed(
) { ) {
getUserVideos(limit: $limit, after: $after, filters: $filters) { getUserVideos(limit: $limit, after: $after, filters: $filters) {
videos { videos {
...VideoCardFields id
} owner {
pageInfo { username
hasNextPage }
endCursor
}
}
}
fragment VideoCardFields on VideoGQL {
id
owner {
id
username
profileImageUri
}
name
screenshotUri
totalShotsMade
totalShots
makePercentage
createdAt
updatedAt
startTime
endTime
private
elapsedTime
screenshotUri
stream {
id
isCompleted
}
tableSize
tags {
tagClasses {
name name
} screenshotUri
name totalShotsMade
} totalShots
currentProcessing { makePercentage
id createdAt
errors { updatedAt
message startTime
} endTime
status elapsedTime
statuses { screenshotUri
status stream {
} isCompleted
} }
} tableSize
tags {
query GetVideoFeed( tagClasses {
$limit: Int! = 5 name
$after: String = null }
$filters: VideoFilterInput = null name
$includeCallersVideos: Boolean = null }
) {
getFeedVideos(
limit: $limit
after: $after
filters: $filters
includeCallersVideos: $includeCallersVideos
) {
videos {
...VideoCardFields
} }
pageInfo { pageInfo {
hasNextPage hasNextPage

View File

@ -17,40 +17,9 @@ query GetShotAnnotationTypes {
} }
} }
mutation UpdateShotAnnotations( query GetShotsWithVideoGql($filterInput: FilterInput!, $limit: Int) {
$shotId: Int! getShotsWithMetadata(filterInput: $filterInput, limit: $limit) {
$annotations: [UpdateAnnotationInputGQL!]! ids
) {
updateShotAnnotations(shotId: $shotId, annotations: $annotations) {
shot {
id
annotations {
shotId
type {
id
name
}
notes
}
}
error {
shotId
msg
}
}
}
## Should be deprecated
query GetShotsWithVideoGql(
$filterInput: FilterInput!
$shotsOrdering: GetShotsOrdering
$limit: Int
) {
getOrderedShots(
filterInput: $filterInput
shotsOrdering: $shotsOrdering
limit: $limit
) {
shots { shots {
id id
videoId videoId
@ -62,40 +31,18 @@ query GetShotsWithVideoGql(
} }
} }
query GetShotsWithJustIds(
$filterInput: FilterInput!
$shotsOrdering: GetShotsOrdering
$limit: Int
$countRespectsLimit: Boolean
) {
getOrderedShots(
filterInput: $filterInput
shotsOrdering: $shotsOrdering
limit: $limit
countRespectsLimit: $countRespectsLimit
) {
count
shots {
id
videoId
}
}
}
## Reserved for playlists (which are created from a filter) ## Reserved for playlists (which are created from a filter)
query GetShotsWithMetadataFilterResult( query GetShotsWithMetadataFilterResult(
$filterInput: FilterInput! $filterInput: FilterInput!
$shotsOrdering: GetShotsOrdering $shotsPagination: GetShotsPagination
$limit: Int $limit: Int
$ids: [Int!] $ids: [Int!]
$countRespectsLimit: Boolean
) { ) {
getOrderedShots( getShotsWithMetadata(
filterInput: $filterInput filterInput: $filterInput
shotsOrdering: $shotsOrdering shotsPagination: $shotsPagination
limit: $limit limit: $limit
ids: $ids ids: $ids
countRespectsLimit: $countRespectsLimit
) { ) {
count count
shots { shots {
@ -143,6 +90,15 @@ fragment ShotWithAllFeatures on ShotGQL {
id id
} }
falsePositiveScore falsePositiveScore
video {
id
stream {
resolution {
width
height
}
}
}
createdAt createdAt
updatedAt updatedAt
cueObjectFeatures { cueObjectFeatures {
@ -168,12 +124,4 @@ fragment ShotWithAllFeatures on ShotGQL {
serializedShotPaths { serializedShotPaths {
b64EncodedBuffer b64EncodedBuffer
} }
annotations {
shotId
type {
id
name
}
notes
}
} }

View File

@ -37,16 +37,14 @@ query getLoggedInUser {
username username
isAdmin isAdmin
profileImageUri profileImageUri
fargoRating
activeVideoId activeVideoId
createdAt createdAt
updatedAt updatedAt
videosPrivateByDefault
} }
} }
query GetUserPlayTime($userId: Int!, $filters: VideoFilterInput) { query GetUserPlayTime($userId: Int!) {
getPlayTime(userId: $userId, filters: $filters) { getPlayTime(userId: $userId) {
totalSeconds totalSeconds
} }
} }
@ -59,101 +57,9 @@ query getUsernames(
getUsernames(matchString: $matchString, limit: $limit, after: $after) getUsernames(matchString: $matchString, limit: $limit, after: $after)
} }
query getUserRelationshipsMatching(
$userId: Int!
$matchString: String!
$limit: Int = null
$after: String = null
) {
getUserRelationshipsMatching(
userId: $userId
matchString: $matchString
limit: $limit
after: $after
) {
relationships {
toUser {
username
id
}
toUserFollows
toUserIsFollowedBy
}
}
}
query GetUserTags { query GetUserTags {
getUserTags { getUserTags {
id id
name name
} }
} }
mutation followUser($followedUserId: Int!) {
followUser(followedUserId: $followedUserId) {
username
id
following {
id
username
}
followers {
id
username
}
}
}
mutation unfollowUser($followedUserId: Int!) {
unfollowUser(followedUserId: $followedUserId) {
username
id
following {
id
username
}
followers {
id
username
}
}
}
query getUserFollowingFollowers {
getLoggedInUser {
id
following {
id
username
}
followers {
id
username
}
}
}
query doesUsernameExist($candidateUsername: String!) {
doesUsernameExist(candidateUsername: $candidateUsername)
}
mutation editUser(
$username: String
$fargoRating: Int
$videosPrivateByDefault: Boolean
) {
editUser(
input: {
username: $username
fargoRating: $fargoRating
videosPrivateByDefault: $videosPrivateByDefault
}
) {
id
firebaseUid
username
fargoRating
updatedAt
videosPrivateByDefault
}
}

View File

@ -5,10 +5,46 @@ query GetStreamMonitoringDetails($videoId: Int!, $debuggingJson: JSON) {
makePercentage makePercentage
elapsedTime elapsedTime
currentHomography { currentHomography {
...HomographyInfo crop {
left
top
width
height
}
pockets {
left
top
width
height
}
sourcePoints {
topLeft {
x
y
}
topSide {
x
y
}
topRight {
x
y
}
bottomLeft {
x
y
}
bottomSide {
x
y
}
bottomRight {
x
y
}
}
} }
stream { stream {
id
linksRequested linksRequested
uploadsCompleted uploadsCompleted
segmentProcessingCursor segmentProcessingCursor
@ -18,7 +54,6 @@ query GetStreamMonitoringDetails($videoId: Int!, $debuggingJson: JSON) {
initPlaylistUploadStatus initPlaylistUploadStatus
} }
currentProcessing { currentProcessing {
id
errors { errors {
message message
startSegmentIndex startSegmentIndex
@ -110,7 +145,6 @@ query GetVideoForShotTime($videoId: Int!) {
...VideoStreamMetadata ...VideoStreamMetadata
} }
} }
query GetVideo($videoId: Int!) { query GetVideo($videoId: Int!) {
getVideo(videoId: $videoId) { getVideo(videoId: $videoId) {
id id
@ -118,10 +152,47 @@ query GetVideo($videoId: Int!) {
segmentDurations segmentDurations
} }
homographyHistory { homographyHistory {
...HomographyInfo frameIndex
crop {
left
top
width
height
}
pockets {
left
top
width
height
}
sourcePoints {
topLeft {
x
y
}
topSide {
x
y
}
topRight {
x
y
}
bottomLeft {
x
y
}
bottomSide {
x
y
}
bottomRight {
x
y
}
}
} }
stream { stream {
id
streamSegmentType streamSegmentType
segments { segments {
segmentIndex segmentIndex
@ -142,14 +213,12 @@ query GetAverageTimePerShotForVideo($videoId: Int!) {
averageTimeBetweenShots averageTimeBetweenShots
} }
} }
query GetElapsedTimeForVideo($videoId: Int!) { query GetElapsedTimeForVideo($videoId: Int!) {
getVideo(videoId: $videoId) { getVideo(videoId: $videoId) {
id id
elapsedTime elapsedTime
} }
} }
query GetMedianRunForVideo($videoId: Int!) { query GetMedianRunForVideo($videoId: Int!) {
getVideo(videoId: $videoId) { getVideo(videoId: $videoId) {
id id
@ -157,53 +226,24 @@ query GetMedianRunForVideo($videoId: Int!) {
} }
} }
fragment StreamWithEndFrames on UploadStreamGQL {
id
streamSegmentType
segmentEndFrames @client
resolution {
width
height
}
segments {
uploaded
valid
segmentIndex
endFrameIndex
framesPerSecond
}
}
fragment SegmentEndFrames on SegmentEndFramesGQL {
id
segmentEndFrames
}
fragment SegmentStartTimes on SegmentStartTimesGQL {
id
segmentStartTimes
}
fragment PlaylistWithSegmentStartTimes on HLSPlaylistGQL {
videoId
segmentDurations
segmentStartTimes @client
}
fragment VideoDurationData on VideoGQL {
id
framesPerSecond
playlist {
...PlaylistWithSegmentStartTimes
}
stream {
...StreamWithEndFrames
}
}
query GetVideoForClipTimes($videoId: Int!) { query GetVideoForClipTimes($videoId: Int!) {
getVideo(videoId: $videoId) { getVideo(videoId: $videoId) {
...VideoDurationData id
framesPerSecond
playlist {
segmentDurations
}
stream {
id
streamSegmentType
segments {
uploaded
valid
segmentIndex
endFrameIndex
framesPerSecond
}
}
} }
} }
@ -214,51 +254,3 @@ query GetHeaderInfoByVideoId($videoId: Int!) {
startTime startTime
} }
} }
mutation FindPrerecordTableLayout($b64Image: String!, $videoId: Int!) {
findPrerecordTableLayout(b64Image: $b64Image, videoId: $videoId) {
...HomographyInfo
}
}
fragment HomographyInfo on HomographyInfoGQL {
frameIndex
crop {
left
top
width
height
}
pockets {
left
top
width
height
}
sourcePoints {
topLeft {
x
y
}
topSide {
x
y
}
topRight {
x
y
}
bottomLeft {
x
y
}
bottomSide {
x
y
}
bottomRight {
x
y
}
}
}

View File

@ -9,44 +9,27 @@ type Query {
videoId: ID! videoId: ID!
intervalDuration: Int! = 300 intervalDuration: Int! = 300
): [MakePercentageIntervalGQL!]! ): [MakePercentageIntervalGQL!]!
getMedals(scope: MedalScope!, userId: Int = null): RequestedMedalsGQL!
getOrderedShots(
filterInput: FilterInput!
ids: [Int!] = null
shotsOrdering: GetShotsOrdering = null
limit: Int! = 500
countRespectsLimit: Boolean! = false
): GetShotsResult!
getShotsWithMetadata( getShotsWithMetadata(
filterInput: FilterInput! filterInput: FilterInput!
ids: [Int!] = null ids: [Int!] = null
shotsPagination: GetShotsPagination = null shotsPagination: GetShotsPagination = null
limit: Int! = 500 limit: Int! = 500
countRespectsLimit: Boolean! = false
): GetShotsResult! ): GetShotsResult!
getShots( getShots(
filterInput: FilterInput! filterInput: FilterInput!
shotsPagination: GetShotsPagination = null shotsPagination: GetShotsPagination = null
limit: Int! = 500 limit: Int! = 500
countRespectsLimit: Boolean! = false
): [ShotGQL!]! ): [ShotGQL!]!
getShotsByIds(ids: [Int!]!): [ShotGQL!]! getShotsByIds(ids: [Int!]!): [ShotGQL!]!
getShotAnnotationTypes(errorTypes: Boolean = false): [ShotAnnotationTypeGQL!]! getShotAnnotationTypes(errorTypes: Boolean = false): [ShotAnnotationTypeGQL!]!
getUser(userId: Int!): UserGQL getUser(userId: Int!): UserGQL
doesUsernameExist(candidateUsername: String!): Boolean!
getLoggedInUser: UserGQL getLoggedInUser: UserGQL
getUsernames( getUsernames(
matchString: String = null matchString: String = null
limit: Int = null limit: Int = null
after: String = null after: String = null
): [String!]! ): [String!]!
getUserRelationshipsMatching( getPlayTime(userId: Int!): UserPlayTimeGQL!
userId: Int!
matchString: String = null
limit: Int = 100
after: String = null
): UserRelationshipsResult!
getPlayTime(userId: Int!, filters: VideoFilterInput = null): UserPlayTimeGQL!
getUserVideos( getUserVideos(
userId: Int = null userId: Int = null
limit: Int! = 5 limit: Int! = 5
@ -56,12 +39,6 @@ type Query {
getUserTags: [TagGQL!]! getUserTags: [TagGQL!]!
getVideo(videoId: Int!, debuggingJson: JSON = null): VideoGQL! getVideo(videoId: Int!, debuggingJson: JSON = null): VideoGQL!
getVideos(videoIds: [Int!]!): [VideoGQL!]! getVideos(videoIds: [Int!]!): [VideoGQL!]!
getFeedVideos(
limit: Int! = 5
after: String = null
includeCallersVideos: Boolean = true
filters: VideoFilterInput = null
): VideoHistoryGQL!
} }
type AggregateResultGQL { type AggregateResultGQL {
@ -165,7 +142,6 @@ input FilterInput @oneOf {
videoId: [Int!] videoId: [Int!]
userId: [Int!] userId: [Int!]
username: [String!] username: [String!]
fargoRating: FloatRangeFilter
make: [Boolean!] make: [Boolean!]
tags: [VideoTagInput!] tags: [VideoTagInput!]
annotations: [ShotAnnotationInput!] annotations: [ShotAnnotationInput!]
@ -190,8 +166,6 @@ input FilterInput @oneOf {
missAngleInDegrees: FloatRangeFilter missAngleInDegrees: FloatRangeFilter
marginOfErrorInDegrees: FloatRangeFilter marginOfErrorInDegrees: FloatRangeFilter
createdAt: DateRangeFilter createdAt: DateRangeFilter
totalDistance: FloatRangeFilter
runLength: FloatRangeFilter
} }
input FloatRangeFilter { input FloatRangeFilter {
@ -272,52 +246,6 @@ type MakePercentageIntervalGQL {
elapsedTime: Float! elapsedTime: Float!
} }
type RequestedMedalsGQL {
distanceOver66: MedalGQL
distanceOver78: MedalGQL
distanceOver90: MedalGQL
runLength3: MedalGQL
runLength5: MedalGQL
runLength8: MedalGQL
runLength10: MedalGQL
runLength15: MedalGQL
runLength20: MedalGQL
runLength25: MedalGQL
runLength30: MedalGQL
runLength40: MedalGQL
runLength50: MedalGQL
totalMakes25: MedalGQL
totalMakes50: MedalGQL
totalMakes75: MedalGQL
totalMakes100: MedalGQL
totalMakes200: MedalGQL
totalMakes300: MedalGQL
totalMakes400: MedalGQL
totalMakes500: MedalGQL
totalMakes750: MedalGQL
totalMakes1000: MedalGQL
dayStreak2: MedalGQL
dayStreak3: MedalGQL
dayStreak4: MedalGQL
dayStreak5: MedalGQL
dayStreak6: MedalGQL
dayStreak7: MedalGQL
dayStreak14: MedalGQL
dayStreak21: MedalGQL
dayStreak30: MedalGQL
dayStreak60: MedalGQL
dayStreak90: MedalGQL
}
type MedalGQL {
count: Int!
}
input MedalScope @oneOf {
videoId: Int
interval: TimeInterval
}
type GetShotsResult { type GetShotsResult {
shots: [ShotGQL!]! shots: [ShotGQL!]!
count: Int count: Int
@ -393,17 +321,13 @@ type SerializedShotPathsGQL {
type UserGQL { type UserGQL {
id: Int! id: Int!
firebaseUid: String firebaseUid: String!
username: String! username: String!
isAdmin: Boolean isAdmin: Boolean!
fargoRating: Int
activeVideoId: Int activeVideoId: Int
profileImageUri: String profileImageUri: String
createdAt: DateTime createdAt: DateTime
updatedAt: DateTime updatedAt: DateTime
videosPrivateByDefault: Boolean
following: [UserGQL!]
followers: [UserGQL!]
} }
type ShotAnnotationGQL { type ShotAnnotationGQL {
@ -439,7 +363,6 @@ type VideoGQL {
elapsedTime: Float elapsedTime: Float
framesPerSecond: Float! framesPerSecond: Float!
tableSize: Float! tableSize: Float!
private: Boolean!
stream: UploadStreamGQL stream: UploadStreamGQL
playlist: HLSPlaylistGQL playlist: HLSPlaylistGQL
tags: [VideoTag!]! tags: [VideoTag!]!
@ -512,7 +435,6 @@ type VideoTagClass {
} }
type HomographyInfoGQL { type HomographyInfoGQL {
id: Int!
frameIndex: Int! frameIndex: Int!
crop: BoundingBoxGQL! crop: BoundingBoxGQL!
pockets: [BoundingBoxGQL!]! pockets: [BoundingBoxGQL!]!
@ -542,7 +464,6 @@ type IntPoint2D {
} }
type VideoProcessingGQL { type VideoProcessingGQL {
id: Int!
errors: [VideoProcessingErrorGQL!]! errors: [VideoProcessingErrorGQL!]!
status: ProcessingStatusEnum! status: ProcessingStatusEnum!
statuses: [VideoProcessingStatusGQL!]! statuses: [VideoProcessingStatusGQL!]!
@ -573,33 +494,6 @@ type VideoProcessingStatusGQL {
updatedAt: DateTime updatedAt: DateTime
} }
input GetShotsOrdering {
orderings: [ShotsOrderingComponent!]!
}
input ShotsOrderingComponent @oneOf {
videoCreation: DatetimeShotOrdering
marginOfError: FloatShotOrdering
videoId: IntShotOrdering
startFrame: IntShotOrdering
runLength: IntShotOrdering
}
input DatetimeShotOrdering {
descending: Boolean! = true
startingAt: DateTime = null
}
input FloatShotOrdering {
descending: Boolean! = true
startingAt: Float = null
}
input IntShotOrdering {
descending: Boolean! = true
startingAt: Int = null
}
input GetShotsPagination { input GetShotsPagination {
createdAfter: CreatedAfter! createdAfter: CreatedAfter!
startFrameAfter: Int! startFrameAfter: Int!
@ -610,28 +504,10 @@ input CreatedAfter @oneOf {
createdAt: DateTime createdAt: DateTime
} }
type UserRelationshipsResult {
inquiringUser: UserGQL!
relationships: [UserRelationship!]!
}
type UserRelationship {
toUser: UserGQL!
toUserFollows: Boolean!
toUserIsFollowedBy: Boolean!
}
type UserPlayTimeGQL { type UserPlayTimeGQL {
totalSeconds: Float! totalSeconds: Float!
} }
input VideoFilterInput {
isStreamCompleted: Boolean = null
requireCursorCompletion: Boolean! = true
createdAt: DateRangeFilter = null
excludeVideosWithNoShots: Boolean = null
}
type VideoHistoryGQL { type VideoHistoryGQL {
videos: [VideoGQL!]! videos: [VideoGQL!]!
pageInfo: PageInfoGQL! pageInfo: PageInfoGQL!
@ -642,6 +518,11 @@ type PageInfoGQL {
endCursor: String endCursor: String
} }
input VideoFilterInput {
isStreamCompleted: Boolean = null
requireCursorCompletion: Boolean! = true
}
type TagGQL { type TagGQL {
name: String! name: String!
id: Int! id: Int!
@ -672,10 +553,6 @@ type Mutation {
fileExt: String = ".png" fileExt: String = ".png"
): GetProfileUploadLinkReturn! ): GetProfileUploadLinkReturn!
editProfileImageUri(profileImageUri: String!): UserGQL! editProfileImageUri(profileImageUri: String!): UserGQL!
editUser(input: EditUserInputGQL!): UserGQL!
followUser(followedUserId: Int!): UserGQL!
unfollowUser(followedUserId: Int!): UserGQL!
findPrerecordTableLayout(b64Image: String!, videoId: Int!): HomographyInfoGQL
createUploadStream( createUploadStream(
videoMetadata: VideoMetadataInput! videoMetadata: VideoMetadataInput!
): CreateUploadStreamReturn! ): CreateUploadStreamReturn!
@ -726,7 +603,18 @@ type OtherErrorNeedsNote {
} }
type UpdateShotAnnotationReturn { type UpdateShotAnnotationReturn {
shot: ShotGQL value: SuccessfulUpdateUpdateShotAnnotationErrors!
}
union SuccessfulUpdateUpdateShotAnnotationErrors =
SuccessfulUpdate
| UpdateShotAnnotationErrors
type SuccessfulUpdate {
value: Boolean!
}
type UpdateShotAnnotationErrors {
error: DoesNotOwnShotErr error: DoesNotOwnShotErr
} }
@ -761,12 +649,6 @@ type TooManyProfileImageUploadsErr {
linksRequested: Int! linksRequested: Int!
} }
input EditUserInputGQL {
username: String = null
fargoRating: Int = null
videosPrivateByDefault: Boolean = null
}
type CreateUploadStreamReturn { type CreateUploadStreamReturn {
videoId: Int! videoId: Int!
} }
@ -777,14 +659,32 @@ input VideoMetadataInput {
endTime: DateTime = null endTime: DateTime = null
gameType: String = null gameType: String = null
tableSize: Float = null tableSize: Float = null
uploadStreamMetadataInput: UploadStreamMetadataInput = null
lastIntendedSegmentBound: Int = null lastIntendedSegmentBound: Int = null
streamSegmentType: StreamSegmentTypeEnum = null streamSegmentType: StreamSegmentTypeEnum = null
private: Boolean = null
endStream: Boolean! = false endStream: Boolean! = false
resolution: VideoResolution = null resolution: VideoResolution = null
framesPerSecond: Float = null framesPerSecond: Float = null
} }
input UploadStreamMetadataInput {
deviceType: DeviceTypeEnum = null
osVersion: String = null
appVersion: String = null
browserName: String = null
browserVersion: String = null
locale: String = null
timezone: String = null
networkType: String = null
ipAddress: String = null
}
enum DeviceTypeEnum {
IOS
ANDROID
BROWSER
}
input VideoResolution { input VideoResolution {
width: Int! width: Int!
height: Int! height: Int!