V2.1 API (Asset endpoints)

PhotoStructure’s v2.1 REST-ish API is pretty simple:


returns ApiAsset = SimpleAsset & (ImageAttrs | VideoAttrs)

interface SimpleAsset {
  assetId: number
  name?: string
  width: number
  height: number
  rotation: number
  capturedAtLocale: string
  aspectRatio: number
  contextTag?: ApiTag // this is the tag shown in the header
  beforeAssetId?: AssetId
  afterAssetId?: AssetId
  durationHMS?: string
  hidden: boolean
  liked: boolean
  excluded: boolean
  deleted: boolean

interface ImageAttrs {
  /** for the fit reducer */
  imgAttrs: StrBoolValued // src, srcSet, sizes, width, ...

interface VideoAttrs {
  videoAttrs: StrBoolValued
  videoSources: StrBoolValued[]



interface ApiAssetInfo {
  assetId: number
  description?: string
  capturedAtLocale: string
  mimetype: string
  files: ApiAssetFile[]
  tags: ApiTag[]
  showOpenFile: boolean // only true if the request is from localhost
  durationHMS?: string // only set for videos
  fps?: number // only set for videos
  focalLength?: string // 35 mm
  // AKA "F number"
  aperture?: number // 4.8
  // AKA "exposure time", but is more often referred as "shutter speed"
  shutterSpeed?: string // 1/100 (does this need to be cleaned up?)
  iso?: number // 100

Looks great! Would love to test it.
Any indication on the 2.1 version release? I am eagerly awaiting the new release as the current release does not work for me due to the rotation bug in docker and I’ve been delaying my imports until this is sorted out.

1 Like

It’s done when it’s done, but still the question, do you have an ETA for us? :slight_smile: