components:
  schemas:
    oldLibraryItemId:
      description: The ID of library items on server version 2.2.23 and before.
      type: string
      nullable: true
      format: 'li_[a-z0-9]{18}'
      example: li_o78uaoeuh78h6aoeif
    libraryItemId:
      type: string
      description: The ID of library items after 2.3.0.
      format: uuid
      example: e4bb1afb-4a4f-4dd6-8be0-e615d233185b
    libraryItemBase:
      type: object
      description: Base library item schema
      properties:
        id:
          $ref: '#/components/schemas/libraryItemId'
        oldLibraryItemId:
          $ref: '#/components/schemas/oldLibraryItemId'
        ino:
          $ref: '../schemas.yaml#/components/schemas/inode'
        libraryId:
          $ref: './Library.yaml#/components/schemas/libraryId'
        folderId:
          $ref: './Folder.yaml#/components/schemas/folderId'
        path:
          description: The path of the library item on the server.
          type: string
        relPath:
          description: The path, relative to the library folder, of the library item.
          type: string
        isFile:
          description: Whether the library item is a single file in the root of the library folder.
          type: boolean
        mtimeMs:
          description: The time (in ms since POSIX epoch) when the library item was last modified on disk.
          type: integer
        ctimeMs:
          description: The time (in ms since POSIX epoch) when the library item status was changed on disk.
          type: integer
        birthtimeMs:
          description: The time (in ms since POSIX epoch) when the library item was created on disk. Will be 0 if unknown.
          type: integer
        addedAt:
          $ref: '../schemas.yaml#/components/schemas/addedAt'
        updatedAt:
          $ref: '../schemas.yaml#/components/schemas/updatedAt'
        isMissing:
          description: Whether the library item was scanned and no longer exists.
          type: boolean
        isInvalid:
          description: Whether the library item was scanned and no longer has media files.
          type: boolean
        mediaType:
          $ref: './mediaTypes/media.yaml#/components/schemas/mediaType'
    libraryItemMinified:
      type: object
      description: A single item on the server, like a book or podcast. Minified media format.
      allOf:
        - $ref: '#/components/schemas/libraryItemBase'
        - type: object
          properties:
            media:
              $ref: './mediaTypes/media.yaml#/components/schemas/mediaMinified'
    libraryItemSequence:
      type: object
      description: A single item on the server, like a book or podcast. Includes series sequence information.
      allOf:
        - $ref: '#/components/schemas/libraryItemBase'
        - type: object
          properties:
            sequence:
              $ref: './entities/Series.yaml#/components/schemas/sequence'
