stremio-addon-sdk
stremio-addon-sdk copied to clipboard
metaHandler video firstAired param issue
For some reason it seems that the view of the sidebar for series is altered if firstAired
is not passed or is current year.
For example a payload like this
{
"meta": {
"name": "The Office",
"background": "https://images.metahub.space/background/medium/tt0386676/img",
"logo": "https://images.metahub.space/logo/medium/tt0386676/img",
"id": "tt0386676",
"videos": [{
"name": "Finale",
"season": 9,
"number": 23,
"firstAired": "2001-01-31T22:00:00.000Z",
"id": "tt0386676:9:23",
"released": "2001-01-31T22:00:00.000Z",
"episode": 23,
"description": "Months after the airing of the documentary, the workers of Dunder Mifflin, past and present, gather for a wedding and a final round of interviews. Mysteries are solved, hatchets are buried, pranks are prunked."
},
...]
}
}
will result to
but if I remove firstAired
property or add the current date like new Date().toISOString()
it will look like this:
One of your screenshots (first one) is shown as a series
meta type, while the second one is shown as a channel
meta type. (like the YouTube addon channels)
In your example response, i don't see you setting a meta.type
, are you setting one?
Yes I'm passing it as it comes from the args
const metaObject = {
id: args.id,
name: parsedName,
background: poster.replace('/poster/', '/background/'),
logo: poster.replace('/poster/', '/logo/'),
posterShape: 'regular',
type: args.type,
videos
};
without changing anything else but the firstAired
property inside videos array it gives me these 2 different results.
I believe this could be a bug, but I can't be certain. The reason why I can't be certain is because Stremio Web was built to be type
agnostic, and mould itself based on the addon responses, so it may also be by design. (based on the future plans we have for Stremio)
I would need to check the code of the desktop app to offer more help. In the meanwhile, what i can say for certain, is that the firstAired
property does not need to be exact. Many community developers (which prefer the series view) hack this with fictive timestamps (difference of one second / hour / etc) to order the episodes as they prefer them ordered.
It may also be possible that released
is specific to channel
, and firstAired
is specific to series
. Again though, I can't be sure without checking the code of the app..
These properties are mandatory for series meta:
id: 'some-id',
title: `Episode ${episode}`,
released: new Date(seriesStartTime + ep),
season: 1,
episode: episode,
I don't think you need to provide firstAired
, should work fine without it. Just that the episodes are sorted based on released
property so be mindful of that.