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)



- DejaVu - 2011-05-03

Image
Explained
(Hopefully)

Reading up on something new can be really boring and tedious (I attempted PHP recently!) - and if you dont understand it from the off, frustrating. You may just want to use this as a reference for the basics of using Github.

I'm going to try to make this as plain and simple as possible (and hopefully short).
It assumes you Putty into a Linux OS or XBMCLive. All commands would require 'sudo' in front of them.
If you use Windows only, still read this guide as it will give you a good understanding, then use this guide to install and use Github in Windows.

My Perception of Github.
I say perception because I may be wrong in places.

Github is a coding community where people share code (or ideas) for a project to help make it better or in MFP's case, to add further features.

Editting online on Github.

Lets suppose we commit (or change) a html document some else has made an error with...

Code:
<HTML>
<HEAD>
</HEAD>
<BODY>
Hello Worlld
</BODY>
</HTML>
Now, the person that uploaded (or pushed) this file has made a typo and you spot it and want to change it.
The easiest way is to do this minor job on Github itself. Once your logged in and have permission to edit the Repo (or it is YOUR repo) there is an Edit button. You click it, make the change (add the comment at the botton) and click Commit.

It simply changes the file, updates it and corrects the typo - but it only adds the changes you made and NOT the entire file (unless you completely rewrote it, whereby Git would know you have).

Every change you make to any file will require a comment to explain what you did. In this case -

"Corrected the word 'Worlld' because someone can't spell"

would be a good, sarcastic comment.

Once you press Commit, you have made a change to that code and it gets a unique Commit ID - this makes it possible for that Commit to be retracted in the future if need be. If it does, the only thing that will be changed (as long as it's not changed too much since) will be the typo.

That concludes the easy section of understanding editting on Github itself.


Editting offline away from Github.

When logged into Github can Fork (Copy) any repo and it will be cloned to you and your login details. If you clone MediaFrontPage your repo will live at http://github/USERNAME/mediafrontpage.git.

Creating a Fork is also known as a branch if I understand correctly, branches (or forks) from the original repo owner can be monitored by them and if the changes are uploaded (pushed) to your fork, the original repo owner can merge the changes into the Master. Ultimately, the changes you made to anything will be available online for all to view or try from your fork. If the fork proves cool, it can be added to the original master (I'm not sure how it's done, I'm hoping Gugahoi does! Wink)

Once you have forked the repo, you can download (clone) the repo to you machine to be edited how you see fit - add features, change things, break things - whatever. BUT, any changes you make are optional when it comes to reuploading (push) them.

Once you have made the changes, you can do a 'git status' and it will compare your changes to the original repo and tell you what files have changed.

If you have a few files that have changed you can specify them from the list you just created with 'git add filename.ext'.

These are all added to the staging area (being ready to upload the changes to the files online, remember, it only uploads the changes unless you completely rewrote the file). If you have a new file - for example a new.css file. You would do this the same way - 'git add /css/new.css" and it will be included in the push.

Now, once the changes are in place and all the files you want added are in the 'staging area', and your happy with the changes and everything still works as you expected, you type 'git commit -m "Here is my comment about what I just did"'.

This will then commit all your changes in the staging area and give Github a comment to add for your commit your about to do.

Now your happy with the changes, everything is cool and ready to upload type 'git push'. It will then ask for your github login password, just to be certain you have access to it and then upload all your changes with your edits to your online repo.

Congrats, if you got this far, any changes you made have been uploaded ready for the world to test or edit.

I would suggest creating you own fork of the MediaFrontPage Repo from Gugahoi and test it out a few times til you understand it, use this as a 'beginners' guide.

If it does go all pearshaped, because it's your repo, you can delete it on Github and Fork it from Gugahoi again from scratch! Wink

Github is like a Social Network for coders and the Network tree for MediaFrontPage (or timeline and branches made) can be viewed here - https://github.com/nick8888/mediafrontpage/network

Once you make a fork from it, your username will also be added to it - I suggest forking from Gugahoi as he is furthest ahead, you can see where I edited the Readme.md today with loads of commits to get it right along the bottom. Smile

Hope the information above is right. If not - tough (jokes), I'll edit it and make it right. But it should get you on your way to learning about Git.

Any questions, try not to fill the thread to much, PM me! Wink


- hernandito - 2011-05-03

Cool Beans,

I have been trying for the longest time to write a second now "Now Playing" widget that enables you to see more than one XBMC client on your network. I have tried copying the current one and trying to make it unique and have not had luck. I do have an idea and I am hoping someone can help.

I did notice that the current widget refers to the $xbmcimgpath variable set in config.php. On the config.php, I would love to have multiple variables like:

$xbmcimgpath2
$xbmcimgpath3
$xbmcimgpath4

On the widget we would have something like this image mockup:

Image

Then one could toggle to the different XBMC client machines and control them appropriately. I am not married to the Radio Buttons, preferably it could be a dropdown list.... that would fit to the right of the control buttons (for real estate sake).

There would be some type of "if" statement that would look at what is checked and it toggles the value of the $xbmcimgpath on the fly to display the right XBMC machine.

This would make my MFP perfect.


- DejaVu - 2011-05-03

I think that would need to have seperate $xbmcjsonservice variables as well to read from the correct Host and what that host is playing.

I cannot see this being to hard to crack as it all ready does it for one Host. Why not 10?

I think your on the right track, it maybe just an 'else' statement if it's selected via a drop down though. Like I said, coding not my strong point! Big Grin


- hernandito - 2011-05-03

DejaVu Wrote:I think that would need to have seperate $xbmcjsonservice variables as well to read from the correct Host and what that host is playing.

I cannot see this being to hard to crack as it all ready does it for one Host. Why not 10?

I think your on the right track, it maybe just an 'else' statement if it's selected via a drop down though. Like I said, coding not my strong point! Big Grin

Awesome explanation on Git...! Thanks...

I did not find the variable $xbmcjsonservice being used in wNowPlaying.php.... In theory I know how it can be done. My issue is that I cannot even code an "if" statement.... and something that triggers the widget to reload if you change the default client.... and whether the $xbmcimgpath = value can be calculated on config.php before and after the widget loads....

I am that bad of a code virgin. I am a little better on html and divs...


- gugahoi - 2011-05-04

Hi all! I'm back and have good news this time!!!

To start off, I think I agree with everything you guys said. We definitely need all the modifications uploaded on git or something. We need to find a system to get everything up there. Will see if I can think of something.

Also, if anyone needs help with coding, don't be afraid to ask. I too am no professional coder. I learn as need comes so I'm sure the more people learning the more features we can add to our project. And with DejaVu's explanation of git everyone can practice and do modifications. One thing I wanted to add is remember git is a controlled version system so if ever there is a modification that breaks the code or something we can all go back to a point where it worked so don't be afraid to modify things (do test them on your computer first tho). And a tip for everyone that is not command-line friendly: there are tons of GUI programs for git. I personally use SmartGit on Mac but I believe there are versions for Windows and Linux too.

And now the good news: I've added TMDB to the search widget and it is possible to add movies straight to CouchPotato's queue. I'm still improving things but the core functionality is there (but as you can see still have some bugs to fix) and I've got a screenshot to show you guys. It is in the imdb branch on git and hopefuly soon I'll add it to the master and will get back to working on the jDownloader widget.

Image


- Nick8888 - 2011-05-04

rflores2323 Wrote:man its hard to keep up with the progress on all the new widgets in this thread. can someone update teh front page with the new stuff for this please.

Sorry I'll try to log in a bit more regularly. Let me know what in particular is needed in a pm and I'll add it.

I've added a link to the alternative github page.


- jamjoe - 2011-05-04

I have everything working except sbpcache. No files ever get written to it. Any reason this wouldn't work on a windows box?


- DejaVu - 2011-05-04

Something new has been added to Sickbeard today, I'm trying to work out exactly what it is. It's something to do with Newznab.

I'm guessing it's like a search for releases and will be really easy to add into a widget. They are calling it the "Sickbeard Newznab Install".

Can this be implemented into the Search Widget perhaps? Does look very good...

CouchPotato Search seems to be getting added. Maybe this is the alternative for TV.

See what you think. It's added to Sickbeards recent update, but is not activated as standard...

http://momo.sickbeard.com/search.html

Generates an XML from the search results and is searching purely for TV Shows.

--EDIT--
It is. Sickbeard now has it's own built in NZB Index that does not need registering to. It searches Newznab natively now! Good stuff.


- thezoggy - 2011-05-05

DejaVu Wrote:Something new has been added to Sickbeard today, I'm trying to work out exactly what it is. It's something to do with Newznab.

I'm guessing it's like a search for releases and will be really easy to add into a widget. They are calling it the "Sickbeard Newznab Install".

Can this be implemented into the Search Widget perhaps? Does look very good...

CouchPotato Search seems to be getting added. Maybe this is the alternative for TV.

See what you think. It's added to Sickbeards recent update, but is not activated as standard...

http://momo.sickbeard.com/search.html

Generates an XML from the search results and is searching purely for TV Shows.

--EDIT--
It is. Sickbeard now has it's own built in NZB Index that does not need registering to. It searches Newznab natively now! Good stuff.

DejaVu, midget is running his own nn for sb users with the api restriction removed... it's not official just yet.. and will require people to upgrade to sab 0.6 (came out today) before it really gets any use.


- DejaVu - 2011-05-05

Been using it this evening and have to say - it's awesome. Finding stuff easier than my other providers did not find! Takes some strain off them too.


- thezoggy - 2011-05-05

DejaVu Wrote:Been using it this evening and have to say - it's awesome. Finding stuff easier than my other providers did not find! Takes some strain off them too.

there are going to be some tweaks soon to all NN providers.. like requesting multiple files in 1 request.. so instead of having to hit the provider 23 times for each ep in a season... it will soon be able to just say give me x,y,z and it returns the results in only 1 hit.. which REALLY will alleviate the stress off providers. midget's nn will obviously get the first of the tweaks amongst some regex tweaks since he is only doing tv and doesn't have to play nice with the other categories...


- gugahoi - 2011-05-05

Hey guys, check it out. Now when you click in a movie when searching from TMDB it shows some extra info straight into the widget. It has some info about it and the ability to toggle cast on and off. It also has links to imdb, moviedb and to add to couchpotato's queue.

Let me know what you guys think!


Also forgot to thank you for the updated readme - it looks awesome!

This new sickbeard newznab feature looks awesome. I will see if it's possible to implement it in the search widget. But from what I see it returns XML info and that would lead to the same problem my first jDownloader widget had for a couple of you guys. But we'll see.

Image

Image


- hernandito - 2011-05-05

gugahoi Wrote:Hey guys, check it out. Now when you click in a movie when searching from TMDB it shows some extra info straight into the widget. It has some info about it and the ability to toggle cast on and off. It also has links to imdb, moviedb and to add to couchpotato's queue.

Let me know what you guys think!

Guga that looks sweet! Searching TMDB is a really nice and handy feature. Thank you.

I think there are some formatting issues, as this is what I get when I view the page in Firefox on Windows.

Image Image Image

These do not look like as nice as your screencaps... What browser are you using? The only thing different I am using is my config.php.


- gugahoi - 2011-05-05

hernandito Wrote:Guga that looks sweet! Searching TMDB is a really nice and handy feature. Thank you.

I think there are some formatting issues, as this is what I get when I view the page in Firefox on Windows.

Image Image Image

These do not look like as nice as your screencaps... What browser are you using? The only thing different I am using is my config.php.

Thanks for letting me know. Been working a lot on that and there are probably some bugs I've missed. I've been testing on chrome on Mac 90% of the time and every now and then I give it a try in firefox. Since things have been changing a lot here, I might have made a mistake with formatting but I'll look into it.

One thing I have been trying to do with absolutely no luck is to get a highslide like feature for the trailers. I just pushed a version that when you click on the trailer (when present) it toggles a div with the youtube link, so I'm happy with that for now but wanted to get the other way working.

I've already tried this and a few other 'lightbox' kind of javascript plugins but for some reason can't get them to work. Would be very happy if someone could help me with that.


update: Found and fixed, will upload soon so test it out and let me know.


- hernandito - 2011-05-05

gugahoi Wrote:Thanks for letting me know. Been working a lot on that and there are probably some bugs I've missed. I've been testing on chrome on Mac 90% of the time and every now and then I give it a try in firefox. Since things have been changing a lot here, I might have made a mistake with formatting but I'll look into it.

update: Found and fixed, will upload soon so test it out and let me know.

Sweet!! Search results look much better now. The TMDB Movie Page still looks quirky, like my middle image above.

Thank you!