spmn / vlc-win10smtc

Integrate VLC Media Player with Windows 10 System Media Transport Controls (SMTC)
GNU General Public License v3.0
46 stars 5 forks source link

Report album title and thumbnail #6

Closed TheUnifox closed 2 weeks ago

TheUnifox commented 3 weeks ago

Report the AlbumTitle, and get the thumbnail from cache. use default thumbnail if none exists in cache.

This would allow vlc to be used as a music app for stream overlays that read from the api, and need a thumbnail image. I'm using the album title to report a link to the song for the song command

spmn commented 2 weeks ago

Thanks for the contribution! I will create a new release soon with the updated binaries for easier distribution.

Also, while briefly testing it, I stumbled upon a little issue, so I will let it here in case me or someone else would ever like to take a look at it: the first time a new song comes up, the default image is sent over to SMTC instead of the actual album art. I would guess that happens because the image has not been cached by VLC yet, and VLC extract the image asynchronously. That would explain why going back and forth through the playlist "fixes" the issue. Maybe there is a VLC callback for artwork processing that we could use to push the correct image, or worst case scenario -- keep polling from time to time.

TheUnifox commented 2 weeks ago

Ya, it's nice that vlc auto downloads most thumbnails, ever for not very well known artists. Once it does download and cache it reports it, until it has one it just reports the default. I honestly have no idea how to make plugins for vlc, I just looked at what was there and inferred lol. If there is something for when the image gets cached that would be good, just send another report with the image. There is an occasional crash where it seems an empty art uri slips through without being changed to the default.

spmn commented 2 weeks ago

Crashes are the most annoying things.

Where/when exactly does it crash? Is it a crash due to operating on invalid inputs or is it just some unhandled C++ expression from the WinRT layer? Do you have any consistent way of reproducing the problem?

TheUnifox commented 2 weeks ago

Based on checking what file path is being used when it crashes, it seems like the file path being passed is empty. Which normally an empty path would be caught and set to the default. But somehow an empty path sometimes slips through and causes a crash due to the file stream not being able to access it.

spmn commented 2 weeks ago

It is ok, I've added some extra checks to make sure most (all?) error paths are handled gracefully.