Kodi Community Forum
MediaFrontPage - Web interface with widget type architecture to control multiple apps - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116)
+--- Thread: MediaFrontPage - Web interface with widget type architecture to control multiple apps (/showthread.php?tid=83304)



- Nick8888 - 2010-11-05

Strange that it works for tv shows but not movies. Is xbmc's default web interface working? Are you on the latest version of xbmc?


- gugahoi - 2010-11-05

Zarquon Wrote:Try changing the path to
Code:
http://IP:port/sickbeard/comingEpisodes

That doesn't work either. Any other suggestions? All I did was keep the older widget and it works beautifully. What is it that you're trying to change? Anything major? Because I'd be very happy to keep mine the way it is.


- hotlobster - 2010-11-05

Quote:Strange that it works for tv shows but not movies. Is xbmc's default web interface working? Are you on the latest version of xbmc?

Yes web interface and other json based app like Awx are working flawlessly.
I'm with today svn. I'm wondering what kind of usefull log i could provide you.


- Nick8888 - 2010-11-05

can you try it with this:
http://host/mediafrontpage/widgets/wXBMCLibrary.php?w=rm&style=w&a=p&bc=rm&videoid=690

EDIT: on second thoughts it probably won't affect it.


- hotlobster - 2010-11-05

Code:
XBMC's JSON API did not respond.

Check your configuration (config.php) and that the JSON service variable is configured correctly and that the Service is running.

{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": { "sortorder" : "ascending", "fields" : [ "genre", "director", "trailer", "tagline", "plot", "plotoutline", "title", "originaltitle", "lastplayed", "showtitle", "firstaired", "duration", "season", "episode", "runtime", "year", "playcount", "rating", "writer", "studio", "mpaa", "premiered", "album" ] }, "id": 1}

XBMC's JSON API did not respond.

Check your configuration (config.php) and that the JSON service variable is configured correctly and that the Service is running.

{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": { "sortorder" : "ascending", "fields" : [ "genre", "director", "trailer", "tagline", "plot", "plotoutline", "title", "originaltitle", "lastplayed", "showtitle", "firstaired", "duration", "season", "episode", "runtime", "year", "playcount", "rating", "writer", "studio", "mpaa", "premiered", "album" ] }, "id": 1}

Strangely it responds well to all other mediafrontpage query.


- Nick8888 - 2010-11-05

I'll update my xbmc later and see if I get it too.


- gugahoi - 2010-11-05

I did some studying on php and css and got to this with the queue in the SAB widget. Managed to to different colours for different %'s, got the name inside the progress bar and limited it to 30 something characters so it doesn't overflow the progress bar. Let me know what you think.

Image

While I was doing those also thought maybe if you don't want to add the name in the bar put the percentage in, which is pretty easy to do. Lastly, there could be a nice progress bar with a white gradient kind of thing which from my research didn't seem to be too hard to accomplish.


- Nick8888 - 2010-11-06

@hotlobster, I can confirm it works on the latest svn. Can you check your xbmc log for any messages. I also tested on the pvr testing branch but the json server in that appeared to have issues.

@gugahoi, I've moved the labels to the progress bars for sabnzbd. Let me if you have any issues. I'm not too sure what you mean by white gradient kind of thing, mockups are best.


- gugahoi - 2010-11-06

Thanks, but I'd already done it. Just to let you know, I've downloaded the latest svn to check out the modifications and comingEpisodes widget still doesn't work. I have to use the older one. I like how you've added side scrolling to the widgets tho.

I've done some more modifications to the widget too. I've placed a scrolling text for the names that don't fit, a Overall status bar with the ETA and total and remaining gigs for the queue and implemented different colours for different percentages( so far just red yellow green).

Also added the colours to the hard drives widget and put the percentage inside the bar as well.


- Nick8888 - 2010-11-06

Sounds great. Let me know if you want write access to commit any of the changes.


- hotlobster - 2010-11-06

Here is the xbmc log when i click on movie title:

Code:
DEBUG: Time to retrieve movies from dataset = 11
11:28:18 T:2956897136 M:801865728   DEBUG: GetSetsNav query: SELECT sets.idSet,sets.strSet,COUNT(1) AS c,count(files.playCount) FROM sets JOIN setlinkmovie ON sets.idSet=setlinkmovie.idSet JOIN movie ON setlinkmovie.idMovie=movie.idMovie JOIN files ON files.idFile=movie.idFile  GROUP BY sets.idSet HAVING c>1
11:28:18 T:2956897136 M:801865728   DEBUG: GetMoviesByWhere query: select * from movieview WHERE movieview.idMovie NOT IN (SELECT idMovie FROM setlinkmovie s1 JOIN(SELECT idSet, COUNT(1) AS c FROM setlinkmovie GROUP BY idSet HAVING c>1) s2 ON s2.idSet=s1.idSet)
11:28:18 T:2956897136 M:802500608   DEBUG: Time for actual SQL query = 4
11:28:18 T:2956897136 M:802070528   DEBUG: Time to retrieve movies from dataset = 163
11:28:20 T:2813418352 M:792879104   DEBUG: DoWork - took 222 ms to load special://masterprofile/Thumbnails/a/a38f1e2c.jpg

As you can see xbmc answered well, and send the according thumbnail too.

Here is a capture after clicking on a movie title:

Image

I Use Mysql database for library. I'd like to catch the Json data mediafrontapge receive. Where in the code I could printf the json output for debug ?


- toby77jo - 2010-11-06

Hi,

As of 2 days the sicbeard page is empty, anyone see something bad on my config? aldo the Control does not work, give me file not found..

Also chaning position of any dashboard give popup :problem saving layout, file not writeable, and i have done chmod -R 777 on my entire www dir:


<?php
// enter hostname and port of the xbmc json service here. By default 8080
$xbmcjsonservice = "http://xbmc:[email protected]:8080/jsonrpc"; //remove 'xbmc:xbmc@' if your xbmc install does not require a password.
$xbmcimgpath = 'http://xbmc:[email protected]:8080/vfs/'; //leave as default if unsure

// enter path to sickbeards's coming episodes page
$sickbeardcomingepisodes = 'http://xbmc:[email protected]:8081/comingEpisodes';

// enter SABnzbd+ URL and API key
$saburl = 'http://192.168.1.53:9200/'; // The full URL you use to access SABnzbd.
$sabapikey = '9d564347729a024dd39d2fe9216703ba'; // SABnzbd's API Key found in Config>General.

// enter navigation bar links
$navlink;
$navlink["XBMC"] = "http://xbmc:[email protected]:8080";
$navlink["Sickbeard"] = "http://192.168.1.53:8081";
$navlink["Couch Potato"] = "http://192.168.1.53:8080";
$navlink["Transmission"] = "http://xbmc:[email protected]:8090/transmission/web/";
$navlink["Sabnzbd"] = "http://192.168.1.53:9200/";
$navlink["Synology"] = "http://xbmc:[email protected]:5000/";
$navlink["XBMC remote control"] = "http://192.168.1.24/index.html";
$navlink["Joomla"] = "http://192.168.1.24/administrator/index.php";

// enter shortcut links for control section
$shortcut;
$shortcut["Input - XBMC"] = "http://192.168.1.24:8080/input/xbmc";
$shortcut["Input - Pay TV"] = "http://192.168.1.24:8080/input/cable";
$shortcut["Input - Games"] = "http://192.168.1.24:8080/input/games";
$shortcut["Now Playing"] = "http://192.168.1.24:8080/nowplaying";
$shortcut["Turn TV On"] = "http://192.168.1.24:8080/tv/on";
$shortcut["Turn TV Off"] = "http://192.168.1.24:8080/tv/off";
$shortcut["Turn Xbox On"] = "http://192.168.1.24:8080/xbox/on";
$shortcut["Turn Xbox Off"] = "http://192.168.1.24:8080/xbox/off";
$shortcut["Update XBMC"] = "http://192.168.1.24:8080/updatevideolibrary";

// enter directories for hard drive section
$drive;
$drive["/"] = "/";
$drive["Sata 1"] = "/media/NAS/";
$drive["Sata 2"] = "/media/tv/";
$drive["Sata 3"] = "/media/music/";
$drive["Sata 4"] = "/media/tvix/";

?>


- gugahoi - 2010-11-06

Nick8888 Wrote:Sounds great. Let me know if you want write access to commit any of the changes.

I'd be happy to, but remember I'm a beginner in programming so it is very likely that the way I get stuff done is not optimal, but if you don't care much about efficiency and want me to add the features anyway then I'll be very happy to do it.

I forgot to ask before, but any chance you could show me an example of how to use the sab api in the code? I was thinking of maybe adding an onclick event on PAUSED to start the queue. I can also see some expansions of the functionality, mostly with onclick events to pause/ resume specific items and change the speed limit. What do you think?

The progress bar I referred to before was something like this.

@toby: Since the last couple of updates the comingEpisodes widget broke for me too, I think your best bet would be to try and use the older one.This one is the last one that worked for me.


- hotlobster - 2010-11-06

Hi

I've tested the jsonrpc request manually with curl and it answers ok apparently:

Quote:curl -i -X POST -d '{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": { "sortorder" : "ascending", "fields" : [ "genre", "director", "trailer", "tagline", "plot", "plotoutline", "title", "originaltitle", "lastplayed", "showtitle", "firstaired", "duration", "season", "episode", "runtime", "year", "playcount", "rating", "writer", "studio", "mpaa", "premiered", "album" ] }, "id": 1}' http://xbmc:xbmc@localhost:8080/jsonrpc

Here is a PAstebin off the output:

http://pastebin.com/YufVspGK


- Nick8888 - 2010-11-06

hotlobster Wrote:Here is the xbmc log when i click on movie title:

Code:
DEBUG: Time to retrieve movies from dataset = 11
11:28:18 T:2956897136 M:801865728   DEBUG: GetSetsNav query: SELECT sets.idSet,sets.strSet,COUNT(1) AS c,count(files.playCount) FROM sets JOIN setlinkmovie ON sets.idSet=setlinkmovie.idSet JOIN movie ON setlinkmovie.idMovie=movie.idMovie JOIN files ON files.idFile=movie.idFile  GROUP BY sets.idSet HAVING c>1
11:28:18 T:2956897136 M:801865728   DEBUG: GetMoviesByWhere query: select * from movieview WHERE movieview.idMovie NOT IN (SELECT idMovie FROM setlinkmovie s1 JOIN(SELECT idSet, COUNT(1) AS c FROM setlinkmovie GROUP BY idSet HAVING c>1) s2 ON s2.idSet=s1.idSet)
11:28:18 T:2956897136 M:802500608   DEBUG: Time for actual SQL query = 4
11:28:18 T:2956897136 M:802070528   DEBUG: Time to retrieve movies from dataset = 163
11:28:20 T:2813418352 M:792879104   DEBUG: DoWork - took 222 ms to load special://masterprofile/Thumbnails/a/a38f1e2c.jpg

As you can see xbmc answered well, and send the according thumbnail too.

Here is a capture after clicking on a movie title:

Image

I Use Mysql database for library. I'd like to catch the Json data mediafrontapge receive. Where in the code I could printf the json output for debug ?

Try adding this printf line in widgets/libXBMCLibrary.php > under case: "d": // Display
Code:
                case "rm": // Recent Movies
                    $request = '{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": { "sortorder" : "ascending", "fields" : [ '.$videodetailfields.' ] }, "id": 1}';
                    $results = jsoncall($request);
  echo print_r($results,1);
                    $videos = $results['result']['movies'];