sh_metadata.lua - util.TableToJSON(media._metadata.extra) returns nil (table expected)
Recent external issues now show an error when requesting any content from YouTube. Videos subsequently fail add/play:
[Media Player] lua/mediaplayer/sh_metadata.lua:149: bad argument #1 to 'TableToJSON' (table expected, got nil)
1. TableToJSON - [C]:-1
2. Save - lua/mediaplayer/sh_metadata.lua:149
3. onReceive - lua/mediaplayer/services/youtube/init.lua:104
4. unknown - lua/mediaplayer/services/base/init.lua:57
Line refers to:
string.format( "%s,", sql.SQLStr( util.TableToJSON(media._metadata.extra) ) ) ..
media._metadata.extra is nil and not a table when requesting YouTube (or most other) content.
In my observation in a presently-running server's sv.db, with over 80k unique media requests logged by media player, has historically been a moot or empty entry except for the very rare SoundCloud requests.
This pull request populates this database entry with nil or "" to maintain parity with existing database sets. "util.TableToJSON(media._metadata.extra)" will no longer be called. Tested and seems to return YouTube functionality.
Request further testing with other media sources. I have a feeling SoundCloud has not and will not continue to work, though this might be a trivial problem.
https://github.com/samuelmaddock/gm-mediaplayer/pull/57