stremio-addon-sdk: Not able to add series correctly

I’ve added a TV series in Catalog format like bellow:

const CATALOG = [
    {
        id: "test_001:1:1",
        season: 1,
        episode: 1,
        type: "series",
        name: "My Test Series",
        poster: 'https://upload.wikimedia.org/wikipedia/en/thumb/e/e5/Pok%C3%A9mon_Detective_Pikachu_teaser_poster.jpg/220px-Pok%C3%A9mon_Detective_Pikachu_teaser_poster.jpg',
        description: 'Pikachu!!!'
    },
    {
        id: "lai001:1:2",
        season: 1,
        episode: 2,
        type: "series",
        name: "My Test Series",
        poster: 'https://upload.wikimedia.org/wikipedia/en/thumb/e/e5/Pok%C3%A9mon_Detective_Pikachu_teaser_poster.jpg/220px-Pok%C3%A9mon_Detective_Pikachu_teaser_poster.jpg',
        description: 'Pikachu!!!'
    }];

With stream list like this:

const STREAMS = {
    "lai001:1:1": {
        infoHash: "b9302d042f8f856d042e4c74e38cca6173c8b40e", fileIdx: 5
    },
    "lai001:1:2": {
        infoHash: "b9302d042f8f856d042e4c74e38cca6173c8b40e", fileIdx: 5
    }
};

But it’s not being grouped in Stremio and streams are not found.

image image

What’s wrong in my code? how can I add a series?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (6 by maintainers)

Most upvoted comments

This seems to be a bug, in order to show videos as episode you’ll need to use number instead of episode.

Here is a working example:

builder.defineMetaHandler(function(args) {

    const videos = []

    const oneDay = 24 * 60 * 60 * 1000

    const now = Date.now()

    videos.push({
        id: 'lai_0001:1:1',
        title: 'My test',
        released: new Date(now - oneDay).toISOString(),
        number: 1,
        season: 1
    })

    videos.push({
        id: 'lai_0001:2:1',
        title: 'My test 2',
        released: new Date(now - (2 * oneDay)).toISOString(),
        number: 1,
        season: 2
    })

    return Promise.resolve({
        meta: {
            id: 'lai_001',
            type: "series",
            name: "My Test",
            poster: 'https://upload.wikimedia.org/wikipedia/en/thumb/e/e5/Pok%C3%A9mon_Detective_Pikachu_teaser_poster.jpg/220px-Pok%C3%A9mon_Detective_Pikachu_teaser_poster.jpg',
            description: 'Pikachu!!!',

            videos
        }
    })
})

The “series” type does not work like the “movie” type. With the “movie” and “tv” types, the stream requests are made as soon as you access the Details page, but with the “series” and “channel” types, the Details page expects the meta to include the videos property, with an array of episodes or videos. When a video or episode is then selected, a stream request will be made for that episode or video id, instead of the meta id (like with “movie” and “tv”)

Check the videos property on this page for more information: https://github.com/Stremio/stremio-addon-sdk/blob/master/docs/api/responses/meta.md

This is the intended behaviour, not a bug.