type SceneFileType {
  size: String
  duration: Float
  video_codec: String
  audio_codec: String
  width: Int
  height: Int
  framerate: Float
  bitrate: Int
}

type ScenePathsType {
  screenshot: String # Resolver
  preview: String # Resolver
  stream: String # Resolver
  webp: String # Resolver
  vtt: String # Resolver
  sprite: String # Resolver
  funscript: String # Resolver
  interactive_heatmap: String # Resolver
  caption: String # Resolver
}

type SceneMovie {
  movie: Movie!
  scene_index: Int
}

type VideoCaption {
  language_code: String!
  caption_type: String!
}

type Scene {
  id: ID!
  title: String
  code: String
  details: String
  director: String
  url: String @deprecated(reason: "Use urls")
  urls: [String!]!
  date: String
  # rating expressed as 1-100
  rating100: Int
  organized: Boolean!
  o_counter: Int
  interactive: Boolean!
  interactive_speed: Int
  captions: [VideoCaption!]
  created_at: Time!
  updated_at: Time!
  "The last time play count was updated"
  last_played_at: Time
  "The time index a scene was left at"
  resume_time: Float
  "The total time a scene has spent playing"
  play_duration: Float
  "The number ot times a scene has been played"
  play_count: Int

  "Times a scene was played"
  play_history: [Time!]!
  "Times the o counter was incremented"
  o_history: [Time!]!

  files: [VideoFile!]!
  paths: ScenePathsType! # Resolver
  scene_markers: [SceneMarker!]!
  galleries: [Gallery!]!
  studio: Studio
  movies: [SceneMovie!]!
  tags: [Tag!]!
  performers: [Performer!]!
  stash_ids: [StashID!]!

  "Return valid stream paths"
  sceneStreams: [SceneStreamEndpoint!]!
}

input SceneMovieInput {
  movie_id: ID!
  scene_index: Int
}

input SceneCreateInput {
  title: String
  code: String
  details: String
  director: String
  url: String @deprecated(reason: "Use urls")
  urls: [String!]
  date: String
  # rating expressed as 1-100
  rating100: Int
  organized: Boolean
  studio_id: ID
  gallery_ids: [ID!]
  performer_ids: [ID!]
  movies: [SceneMovieInput!]
  tag_ids: [ID!]
  "This should be a URL or a base64 encoded data URL"
  cover_image: String
  stash_ids: [StashIDInput!]

  """
  The first id will be assigned as primary.
  Files will be reassigned from existing scenes if applicable.
  Files must not already be primary for another scene.
  """
  file_ids: [ID!]
}

input SceneUpdateInput {
  clientMutationId: String
  id: ID!
  title: String
  code: String
  details: String
  director: String
  url: String @deprecated(reason: "Use urls")
  urls: [String!]
  date: String
  # rating expressed as 1-100
  rating100: Int
  o_counter: Int
    @deprecated(reason: "Unsupported - Use sceneIncrementO/sceneDecrementO")
  organized: Boolean
  studio_id: ID
  gallery_ids: [ID!]
  performer_ids: [ID!]
  movies: [SceneMovieInput!]
  tag_ids: [ID!]
  "This should be a URL or a base64 encoded data URL"
  cover_image: String
  stash_ids: [StashIDInput!]

  "The time index a scene was left at"
  resume_time: Float
  "The total time a scene has spent playing"
  play_duration: Float
  "The number ot times a scene has been played"
  play_count: Int
    @deprecated(
      reason: "Unsupported - Use sceneIncrementPlayCount/sceneDecrementPlayCount"
    )

  primary_file_id: ID
}

enum BulkUpdateIdMode {
  SET
  ADD
  REMOVE
}

input BulkUpdateIds {
  ids: [ID!]
  mode: BulkUpdateIdMode!
}

input BulkSceneUpdateInput {
  clientMutationId: String
  ids: [ID!]
  title: String
  code: String
  details: String
  director: String
  url: String @deprecated(reason: "Use urls")
  urls: BulkUpdateStrings
  date: String
  # rating expressed as 1-100
  rating100: Int
  organized: Boolean
  studio_id: ID
  gallery_ids: BulkUpdateIds
  performer_ids: BulkUpdateIds
  tag_ids: BulkUpdateIds
  movie_ids: BulkUpdateIds
}

input SceneDestroyInput {
  id: ID!
  delete_file: Boolean
  delete_generated: Boolean
}

input ScenesDestroyInput {
  ids: [ID!]!
  delete_file: Boolean
  delete_generated: Boolean
}

type FindScenesResultType {
  count: Int!
  "Total duration in seconds"
  duration: Float!
  "Total file size in bytes"
  filesize: Float!
  scenes: [Scene!]!
}

input SceneParserInput {
  ignoreWords: [String!]
  whitespaceCharacters: String
  capitalizeTitle: Boolean
  ignoreOrganized: Boolean
}

type SceneMovieID {
  movie_id: ID!
  scene_index: String
}

type SceneParserResult {
  scene: Scene!
  title: String
  code: String
  details: String
  director: String
  url: String
  date: String
  # rating expressed as 1-5
  rating: Int @deprecated(reason: "Use 1-100 range with rating100")
  # rating expressed as 1-100
  rating100: Int
  studio_id: ID
  gallery_ids: [ID!]
  performer_ids: [ID!]
  movies: [SceneMovieID!]
  tag_ids: [ID!]
}

type SceneParserResultType {
  count: Int!
  results: [SceneParserResult!]!
}

input SceneHashInput {
  checksum: String
  oshash: String
}

type SceneStreamEndpoint {
  url: String!
  mime_type: String
  label: String
}

input AssignSceneFileInput {
  scene_id: ID!
  file_id: ID!
}

input SceneMergeInput {
  """
  If destination scene has no files, then the primary file of the
  first source scene will be assigned as primary
  """
  source: [ID!]!
  destination: ID!
  # values defined here will override values in the destination
  values: SceneUpdateInput

  # if true, the source history will be combined with the destination
  play_history: Boolean
  o_history: Boolean
}

type HistoryMutationResult {
  count: Int!
  history: [Time!]!
}
