Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sh_metadata.lua - util.TableToJSON(media._metadata.extra) returns nil (table expected) #56

Open
Physics-Dude opened this issue Jun 27, 2023 · 1 comment

Comments

@Physics-Dude
Copy link

Physics-Dude commented Jun 27, 2023

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.
image

@Physics-Dude
Copy link
Author

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.

#57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant