koying / SPMC

fork of xbmc/kodi
Other
632 stars 257 forks source link

Feature Request: Custom Web Server settings for Voice Search feature #185

Open heymoe opened 8 years ago

heymoe commented 8 years ago

I'd like to test the new Android TV Voice Search feature but I currently have non-default Web Server settings and have been running these settings for a while as in I have other applications that access Kodi/SPMC via them up and running already.

Would it be possible to create 3 new xbmc_env.properties options for custom Web Server Port, User and Password or something that would allow for the Voice Search feature to work with custom Web Server settings?

koying commented 8 years ago

Implemented, but did not have time to test. Would you mind? http://download.semperpax.com/spmc/android-arm/SPMC-20160523-2a20a3c-leanback_json_port-armeabi-v7a.apk

Properties are:

https://github.com/koying/SPMC/commit/2a20a3c2c62c4894259d4a1ac61a742a03e28284

heymoe commented 8 years ago

Sure but I won't be able to test until I get home later tonight. I'll let you know the results once get it tested.

heymoe commented 8 years ago

OK, I installed / updated my SPMC instance on my Shield TV with the provided APK and added the new properties to the: spmc_env.properties file like so:

xbmc.jsonPort=8080 xbmc.jsonUser=username xbmc.jsonPwd=password

I rebooted and then started SPMC. Once started I clicked on the Home button to take me back to the leanback home page.

I then tried doing a voice search for a few movies / shows in my SPMC library by clicking on the voice search button on the remote which resulted with information about the movie but I didn't see any results that would have linked back to SPMC.

I also haven't seen any items popup in the recommendations row on the leanback home page from SPMC. I don't know if it matter but I don't see SPMC listed as a recommendation row source under Settings -> Preference -> Home Screen.

I also created a xbmc_env.properties file with the same settings in it to test and it didn't seem to help.

Looking though the spmc.log file and I found a few things of interest:


10:31:32 T:1394374960 DEBUG: CWebServer [MHD]: Failed to bind to port 8080: Address already in use 10:31:32 T:1394374960 NOTICE: WebServer: Started the webserver

Even though the log says it failed to bind to port 8080, I was able to connect via a web browser to port 8080 of my SATV, log in using the username and password I defined and use the web based remote to navigate the running SPMC instance on my Shield TV. Maybe the web server tried to start twice for some reason?

I do have Kodi installed too but I made sure it's web server was turned off just in case.


This one is most likely related to new SQL settings being added to the setting GUI feature. I have had my Mysql settings in the advancedsettings.xml for a while but noticed in the logs that it looks like SPMC failed to load the custom name for the music database I had set. It did load the custom name for my video database correctly. The music database name in my advancesettings.xml is: xbmc201512_music

10:31:29 T:1394374960 ERROR: SQL: Can't create new database: 'MyMusic56' (1044) 10:31:29 T:1394374960 ERROR: Unable to open database: MyMusic56 (0) 10:31:29 T:1394374960 ERROR: Unable to create new database 10:31:29 T:1394374960 NOTICE: Running database version xbmc201512_video99

The SQL settings in the GUI show an empty custom music database name too. I added the name via the GUI and it saved and the errors are now gone in the log so maybe this is a bug on the initial import of the settings from the advancesettings.xml into the GUI?

koying commented 8 years ago

Proved more tricky than I thought. Please try http://download.semperpax.com/spmc/android-arm/SPMC-20160530-be8ec18-leanback_json_port-armeabi-v7a.apk

heymoe commented 8 years ago

Looks like that did the ticket. I can now voice search for things located in the SPMC library and items are showing up in the recommendations row.

heymoe commented 8 years ago

Just wanted to check to make sure you saw my note about the MySQL bug and if you wanted me to open a new issue report for it or not?

Other than that, it looks like the custom options for Voice Search are working with that last build you provided to test.

koying commented 8 years ago

MySQL bug?

heymoe commented 8 years ago

When I installed the first APK file you provided me to test the Voice Search feature and it didn't work, I dug through the logs and noticed that even though I had a custom MySQL library defined in my advancedsettings.xml file for my music library, the logs showed that it didn't read in the custom table name I defined so it was trying to load the default name "MyMusicXX" from my MySQL server.

I noticed that that this test version of SPMC had the new MySQL GUI settings and saw that the custom name for the music library was empty in the GUI and not the custom name I had in the advancedsettings.xml file. The GUI did have the correct custom name for my video library thus I figured that maybe the code that pre-populated the GUI options didn't read in the custom music library name correctly from the advancedsettings.xml file thus the empty name in the GUI and SPMC not opening the correct table on the MySQL server.

I noted this issue at the bottom of my report 6 days ago on here:

https://github.com/koying/SPMC/issues/185#issuecomment-222314062

koying commented 8 years ago

Yep. I see the issue. Thanks

heymoe commented 8 years ago

No problem. Glad to help and test. Thanks for all of your work!

heymoe commented 8 years ago

Hey @koying, just wanted to check to see if there was anything else you wanted me to test related to the Custom Web Server settings for Voice Search settings? The last test version you provided me is still working great using my custom web server settings. I can search for library content from the leanback launcher screen using the voice button on the SATV remote and SPMC recommendations show up in the leanback recommendations list.