-->

filter json results into image path

2019-06-10 19:41发布

问题:

Hello i am using MIT App Inventor 2 to make an app that runs on an old (spare) android phone to display the folder.jpg of currently playing movie (later on I also want to do that with music).

I can't filter the path to use, for example this is the result of the json:

{"id":"VideoGetItem","jsonrpc":"2.0","result":{"item":{"id":1,"label":"2012","thumbnail":"image://F%3a%5cMovies%5c2012%5cfolder.jpg/","type":"movie"}}}

I want to keep: image://F%3a%5cMovies%5c2012%5cfolder.jpg which is the dvd cover (and maybe the label: 2012 which is the title of the movie).

I tried various options like making a list but then I still get text with lot of params between '()'
Can someone help me with this?
Thanks

回答1:

Use the JSON decode block together with the lookup in pairs block. As you can see, it helps to use Do it...



回答2:

I have something that is doing it for me for starters.

I see a flaw but that's in Kodi(.tv) itself (I am not a fan of the library system in kodi, so I put a folder.jpg in every drawer of a movie, but sometimes kodi doesn't display it and presents me with a video preview of the movie, I have to sort that out with kodi developers)

For now I am glad I have it working,

solution picture