Closed lpuglia closed 10 months ago
return Promise.resolve({ meta: results })
this will be { meta: [object Promise] }
{ meta: [object Promise] }
SyntaxError: Unexpected identifier 'Promise'
in the getMovieMeta
function you aren't returning anything. the last line of that function should be return Promise.resolve(metas[id] || null)
instead of Promise.resolve(metas[id] || null)
That should be fixed in the Tutorial, thanks! will keep this open for now
getMovieMeta
is not part of sdk this is your internal function
getMovieMeta
is not part of sdk this is your internal function
@TRtomasz sure, but it should be fixed here: https://stremio.github.io/stremio-addon-guide/sdk-guide/step3
Fixed in the tutorial.
@core1024 @TRtomasz thanks for the help so far, but, there is still something wrong. Now the "No information about this" error is gone, but the page is still empty: I can see the the meta promise is being returned correctly though:
{
meta: Promise {
{
id: 'hiwrld_jellyfish',
type: 'movie',
name: 'Jellyfish',
poster: 'https://images.unsplash.com/photo-1496108493338-3b30de66f9be',
genres: [Array],
description: 'A .mkv video clip useful for testing the network streaming and playback performance of media streamers & HTPCs.',
cast: [Array],
director: [Array],
logo: 'https://b.kisscc0.com/20180705/yee/kisscc0-art-forms-in-nature-jellyfish-recapitulation-theor-jellyfish-5b3dcabcb00692.802484341530776252721.png',
background: 'https://images.unsplash.com/photo-1461783470466-185038239ee3',
runtime: '30 sec'
}
}
}
Is this the expected behaviour? should i not see the backgroud image at least?
@core1024 There is a second issue in the tutorial that doesn't allow to display the meta, can you please modify this page https://stremio.github.io/stremio-addon-guide/sdk-guide/step3 from this:
builder.defineMetaHandler(({type, id}) => {
// Docs: https://github.com/Stremio/stremio-addon-sdk/blob/master/docs/api/requests/defineMetaHandler.md
let results;
switch(type) {
case 'movie':
results = getMovieMeta(id)
break
default:
results = null
break
}
return Promise.resolve({ meta: results })
})
to:
builder.defineMetaHandler(({type, id}) => {
// Docs: https://github.com/Stremio/stremio-addon-sdk/blob/master/docs/api/requests/defineMetaHandler.md
let results;
switch(type) {
case 'movie':
results = getMovieMeta(id)
break
default:
results = null
break
}
return results.then(meta => ({meta}))
})
@lpuglia that will only work if you have meta; otherwise u won't be able to read .'then' from a null variable.
Hello, I just started to develop my first add-on using https://stremio.github.io/stremio-addon-guide. So far so good, but there seems to be a problem with the
defineMetaHandler
, this is my current code:This is the relevant part of the guide: https://stremio.github.io/stremio-addon-guide/sdk-guide/step3
The problem is that when i click on the jellyfish catalog entry i get this: This happens on both desktop app and web app. Is there something wrong with the guide? I can see that the
console.log
s are definitively printed and bothdefineMetaHandler
andgetMovieMetagetMovieMeta
returns with no error but the meta is still empty.