Skip to content

Media Source API #298

@goto-bus-stop

Description

@goto-bus-stop

Currently, media sources have three API methods:

  • search
  • get
  • import

search and get are quite clear and good now, but import is basically a wildcard and requires custom client support. This issue is intended to scope out the features that would be required in a more restrictive API.

Feature Checklist

  • Flagging support for the below features
    Probably just assign each a name. It could be implicit on the implementer end, so Core would determine it based on which methods are available.
  • Import a playlist from a URL
    Like the current YouTube source, on the web client this should open a panel that lists all the media in a playlist, and that has an "import all" button that can be used to import the entire thing into a new üWave playlist.
    • One feature that would be good to have that does not exist right now is pagination; this may be quite difficult though because not all third parties support the type of pagination that üWave needs.
  • Optionally, view playlists belonging to a user account / [other similar concept].
  • Optionally, view playlists of the current user (if account is connected).
    • How to do the account connection stuff?
  • ...
interface MediaSource {
  api?: number;
  name: string;

  get(context: SourceContext, sourceIDs: string[]): Promise<MediaItem[]>;
  search(context: SourceContext, query: string, pagination?: any): Promise<MediaItem[]>;

  // Get media items in a playlist. sourceID may be ID or a playlist URL or etc
  getPlaylistItems(context: SourceContext, sourceID: string): Promise<MediaItem[]>;
  // Get playlists owned by the user [throw error if user has no connected account]
  getSelfPlaylists(context: SourceContext): Promise<PlaylistMeta[]>;
  // Get (public) playlists owned by some other user or similar concept.
  getUserPlaylists(context: SourceContext, userID: string): Promise<PlaylistMeta[]>;
  // maybe?
  searchPlaylists(context: SourceContext, query: string): Promise<PlaylistMeta[]>;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions