Beta

Library Collections allow you to group items of the same content type to form custom collections. Library Collections can contain movies or TV Shows. On this page, we’ll dive into the different collection endpoints you can use to read collection information programmatically from the Channels library.

The library collection model

The collection model contains all the information about the Library Collections in your library, such as their name, art, last watched date, etc. Additionally, you can fetch all of the content of a collection using the nested endpoint.

Properties

id string

The unique identifier for the collection.

name string

The name of the collection.

collection_type string

The type of content contained in the collection.

image_url string

The URL of the fanart image for the collection.

labels array

An array of strings for the labels of the collection. Labels are self assigned strings used for organizing items in the library.

content_count integer

The number of items contained in the collection.

last_watched_at timestamp

The date of the last time content inside the collection was watched.

created_at timestamp

The date when the collection was first added to the library.

updated_at timestamp

The date when the collection was last updated.

GET /api/v1/collections

List all collections

Returns a list of all collections in the library alphabetically.

Optional Attributes

collection_type string

Optionally filter returned collections to a certain type.

Options

  • movies

    Return just Movie Collections.

  • shows

    Return just TV Show Collections.

Request
GET /api/v1/collections
curl http://192.168.1.3:8089/api/v1/collections
Response
[{
  "id": "56",
  "collection_type": "movies",
  "name": "Star Wars",
  "image_url": "https://image.tmdb.org/t/p/w780/itH1Wlzwf6yTNa7fVkYMVUwXlhR.jpg",
  "labels": [
    "star-wars"
  ],
  "content_count": 9,
  "last_watched_at": 1714420318965,
  "created_at": 1714420245903,
  "updated_at": 1714420318965
} ,{
  "id": "50",
   "name": "Harry Potter Collection",
   ...
}]

        

GET /api/v1/collections/:id

Retrieve a collection

This endpoint allows you to retrieve a collection by using its unique identifier.

Required Attributes

id string

The unique identifier of the Collection.

Request
GET /api/v1/collections/44
curl http://192.168.1.3:8089/api/v1/collections/44
Response
{
  "id": "56",
  "collection_type": "movies",
  "name": "Star Wars",
  "image_url": "https://image.tmdb.org/t/p/w780/itH1Wlzwf6yTNa7fVkYMVUwXlhR.jpg",
  "labels": [
    "star-wars"
  ],
  "content_count": 9,
  "last_watched_at": 1714420318965,
  "created_at": 1714420245903,
  "updated_at": 1714420318965
}

        

GET /api/v1/collections/:id/content

Retrieve a collection's contents

This endpoint allows you to retrieve all the content contained by a collection.

Required Attributes

id string

The unique identifier of the Collection.

Optional Attributes

watched boolean

Only return episodes with watch status corresponding to the passed in value.

favorited boolean

Only return episodes with favorited status corresponding to the passed in value.

verified boolean

Only return episodes with verified status corresponding to the passed in value.

source string

Only return episodes sourced from the passed in value.

Options

  • recordings

    Episodes recorded directly via Channels.

  • imports

    Episodes added to the library via local content sources.

  • playon-cloud

    Episodes added to the library from PlayOn Cloud.

  • stream-links

    Episodes added to the library via a Stream Link.

  • stream-files

    Episodes added to the library via a Stream File.

Sorting Attributes

sort string

Sort the response based on the passed in value.

Options

  • custom default

    Sort by the preference of the collection.

  • alpha

    Sort by the title of the content.

  • date_added

    Sort by the date the content was added to the library.

  • date_updated

    Sort by the date the content was updated in the library. Show collections only.

  • date_released

    Sort by the date the content originally aired.

  • date_watched

    Sort by the date the content was last watched.

  • duration

    Sort by length of the content. Movie collections only.

order string

Set the order of the response.

Options

  • asc

    Ascending order.

  • desc

    Descending order.

Request
GET /api/v1/shows/44/contents
curl http://192.168.1.3:8089/api/v1/shows/44/contents
Response
[{
  "id": "118",
  "program_id": "tmdb/movie/11",
  "path": "/Volumes/DVRs/tools/library/movies/new/Star Wars (1977).mkv",
  "title": "Star Wars (1977)",
  "summary": "Princess Leia is captured and held hostage by the evil Imperial forces in their effort to take over the galactic Empire. Venturesome Luke Skywalker and dashing captain Han Solo team together with the loveable robot duo R2-D2 and C-3PO to rescue the beautiful princess and restore peace and justice in the Empire.",
  "content_rating": "PG",
  "image_url": "https://image.tmdb.org/t/p/w780//6FfCtAuVAW8XJjZ7eWeLibRLWTw.jpg",
  "thumbnail_url": "http://localhost:8089/dvr/files/118/preview.jpg",
  "duration": 7484.735,
  "playback_time": 0,
  "release_year": 1977,
  "release_date": "1977-05-25",
  "genres": [
    "Adventure",
    "Action",
    "Science Fiction"
  ],
  "tags": [
    "HD",
    "Dolby Digital",
    "CC"
  ],
  "categories": [
    "Movie"
  ],
  "cast": [
    "Mark Hamill",
    "Harrison Ford",
    "Carrie Fisher",
    "Peter Cushing",
    "Alec Guinness",
    "Anthony Daniels",
    "Kenny Baker",
    "Peter Mayhew",
    "David Prowse",
    "James Earl Jones",
  ],
  "directors": [
    "George Lucas"
  ],
  "watched": true,
  "favorited": false,
  "delayed": false,
  "cancelled": false,
  "corrupted": false,
  "completed": true,
  "processed": true,
  "locked": false,
  "verified": false,
  "created_at": 1673281089000,
  "updated_at": 1714420330006
},{
  "id": "31254",
  "program_id": "183983",
  ...
}]