📖
Etherna Docs
  • Get Started
  • Schema
    • Image
    • Profile
    • Video
    • User's playlists
    • Playlist
Powered by GitBook
On this page
  • Schema versions
  • Schema
  • Feed
  1. Schema

Playlist

A playlist is a collection of video references. Playlists have 3 visibility options:

  • public the playlist is publicly visible in the channel page

  • unlisted the playlist is hidden from the channel, but still openly accessible by anyone (default option for custom playlists)

  • private the basic playlists information are public, such as name, owner, created_at etc., but the description and list of videos is encrypted and stored in a separated file. A private playlist don't have the videos property, but has an additional property encryptedReference with the reference to the encrypted data. To unlock a private playlist the user will have to insert the encryption password when accessing it.

Schema versions

Schema

type SwarmPlaylist = {
  /** Playlist id (used for feed update) */
  id: string
  /** Playlist name (undefined for __channel & __saved) */
  name: string | undefined
  /** Playlist owner */
  owner: string
  /** Playlist creation timestamp */
  createdAt: number
  /** Playlist update timestamp */
  updatedAt: number
} & ({
  /** Playlist visibility: public (show in channel), unlisted (not in channel), private (encrypted) */
  type: "private"
  /** 
   * Encrypted data of the playlist (only for private playlists) 
   * see `EncryptedSwarmPlaylistData` for a reference to the un-encrypted content
   */
  encryptedData: string,
} | {
  /** Playlist visibility: public (show in channel), unlisted (not in channel), private (encrypted) */
  type: "public" | "unlisted"
  /** List of the playlist videos */
  videos: SwarmPlaylistVideoRaw[]
  /** Playlist description */
  description?: string | null
})

type EncryptedSwarmPlaylistData = {
  /** List of the playlist videos */
  videos: SwarmPlaylistVideoRaw[]
  /** Playlist description */
  description?: string | null
}

type SwarmPlaylistVideo = {
  /** Video reference */
  r: string
  /** Video Title */
  t: string
  /** Timestamp of when the videos has been added to playlist */
  a: number
  /** Timestamp of when the video should be visible */
  p?: number
}

Feed

A private and unlisted playlist also shouldn’t have feeds because are intended to be personal and also loaded from the user’s playlists feed.

On the other hand, custom playlists that are public generates a feed root manifest as reference. In this way if a second user wants to subscribe to a particular playlist can do it without losing future updates to that playlist.

Feed info:

  • Owner: address of the user

  • Topic (unencoded): `EthernaPlaylist:${indexOrigin}:${id}` - indexOrigin is the origin of the current index. If the index url is https://index.etherna.io/api the origin is going to be: index.etherna.io. id is the uuidv4 generated for the playlist

  • Type: sequence

PreviousUser's playlists

Last updated 2 years ago

A playlist don’t always have a feed. The default playlist __channel, for instance, don’t have a feed since is loaded directly from the user’s playlists feed (see ).

User's playlists