MacMini:headphones cealsanddave$ python ./Headphones.py
25-Jan-2014 17:37:18 - INFO :: MainThread : Checking to see if the database has all tables....
25-Jan-2014 17:37:18 - INFO :: MainThread : Retrieving latest version information from github
25-Jan-2014 17:37:19 - INFO :: MainThread : Comparing currently installed version with latest github version
25-Jan-2014 17:37:21 - INFO :: MainThread : Headphones is up to date
i had a quick look at the code and couldn't see how they were doing this, but it got me thinking..
could we create some code so that it would check to see if git was present, and if it was then autoupdate based on a string at load or a setting somewhere.
the use of a check first means that non git users (hello, are you out there?) won't be penalised, but those that have it installed will always benefit from the latest code (if they chose to enable it).
cheers,
cealsanddave (well, just dave - ceals is looking after the baby :) )
don't get me wrong here, i appreciate the work that wahlman.j has put into the openconnect app (and many, many other areas) but call me a purist, i like to see/support the development of the original python script.
WebConnect and OpenConnect are the only plexconnect updating options that I know of besides command line. You can also install OpenConnect code as from my github and simply type this in the command prompt if desired:
sudo update.bash
I like using WebConnect or OpenConnect myself to update but that’s on you
Can you try, with the python script, to check if Git is installed.
If it is, in the plexconnect setting, you add a button to update.
If not, you just disable the button and add a text asking to install git to make the updater available.
After a successful update did you think we must restart the plexconnect to take the change or did we can do a restart itself ? (Maybe call a bach script ?, grep the pix, kill it and restart the pledconnect ?)
This is very interesting, however, wonder how well this would fit into the roadmap of PlexCOnnect and the priority it would take.
@Ekristoffe in theory, for example, as per your suggestion the PlexConnect script would have/need to unload/kill itself in order to restart once updated. Once a script kills itself I believe the contol moves out of the hands of the script, umm something like you'll click the update button on the plexconnect settings on your TV and that's it, it would just die and would not be able to restart itself, I think. Also the added sudo commands that may be required unload/kill/restart would require a password.
My guess is what would be possible is on your TV screen it could do is tell you PlexConnect has an update ready and give you the option of updating via a button click which would in turn fire off some git update commands on your Plex server, you would then have to manually restart the script which defeats the purpose though, eh. I think it would be pretty cool to have a notification that there is an update for PlexConnect ready, actually.
Hmm, maybe clicking the update button in settings of PlexConnect could fire the git update commands and then fire off a restart of you plex server machine ;D I know, I know, I'm just saying...
At the moment, I am using gitbox on OSX it allows one free repository to be used and is the simplest method of pull-ing an update, for me, I like to read up on the comments by the devs on what has been changed in the files that have been updated so I can look forward to the change and appreciate it more, that’s just me.
For me, just having an indication that an update is available, on my TV screen would be great!
I was thinking more along the lines of having a cross platform solution. Everyone who might want to check for an update to PlexConnect would have python 2.7 running. Some on a windows machine others on linux, a NAS, PI’s, Mac's. Ideally, there should be platform independent solution for every feature of Plex Connect, me thinks ;). Umm, if a mac specific feature update was implemented what would people not running OSX see on their PlexConnect settings on their TV screens, despair ;).
I most likely am out of my depth in understanding the architecture of PlexConnect and the python framework but just to share my thoughts, the PlexConnect python script interacts with the aTV and PMS on the PMS machine. Is that communication 2 way, umm what I mean to say is, is the connection exclusively to PMS on the server machine. Streaming content and all that I get but for example, the PlexConnect settings has a audio boost setting allowing it to be set to 300, when one changes that, what’s exactly happening, the python script is talking to PMS on the server machine. Can the PlexConnect python script it stop and talk to the machine itself? i.e. change and update files on the machine or run scripts parallel to the current one(the one talking to the PMS).
Anyway, a “check for update” button in PlexConnect settings would be great. I just did some google searching and found this it seems like a way to communicate with git using python. This seemed to be working without git installed. I hope it offers some platform independant solutions for a PlexConnect update, even without git being installed.
Basically, I'm thinking out loud here, platform independant, puthon based and more like any other program works, for example, firefox has a check for update, downloads it and then asks us to let firefox restart itself. The restarting part, maybe not. Checking for update with list of update :D, Awesomesauce!
Your suggestion requires "pip" (never heard of it) or gitpython (as additional library/class)
Long story short, in the end we will all need to have git installed which is not necessarily a bad thing anyway.
The command I suggested in the daemon is a git command, comparisons and tests need to be done in the platform-related-daemon, we will always struggle with crossplatform stuff, but changing a daemon (whether be it windows or linux) it the path of least restistance and easiest to implement.
I was thinking we could have a cgi front-end that runs prior to plexconnect.py that would be able to stop/update/restart plexconnect using a web-browser on demand. I set it up for OSX but haven’t found a way to get it running prior to plexconnect yet. It’s in alpha stage so it could be improved on to add support for any device/os so you can manage any function needed in any browser I would imagine.
I actually got the original idea from a ps3 cgi program called webman and was hoping a similar option could be ported into plexconnect like loading movies or something else via any web-browser any device. I would imagine almost anything with cgi is possible here is a example of what cgi can do (just tap a game and it loads on the ps3) definitely would make for a sick looking remote
@bakman1
Git is probably not supported on all platforms, before I bought a Mac Mini, I was using a Seagate GoFlex NET running debian and then optware and before that a Linux based OS.
My point is, if you look at plex and compare it with other HTPC software out there, what do you find that is really different? It's available on almost all platforms. Chromecast comes out and bham! plex has an app for it. It's the USP(Unique Selling Point) of plex, at least that is the way I see it.
Coming back to git, git does not have a package/installer for every device. The only reason I can think of why PlexConnect cannot be hosted on plex servers is the legal implications with respect to Apple.
I do understand your point though, about it being easier to code for OS’s independently! The documentation it would require and time to code along with UAT(User Acceptance Testing) needs to be evaluated though, for each OS.
So what’s next, there is a OSX app then there will be a request for a windows based app, linux, synology, I think that is kinda counterproductive. A python guru is needed; I'm sure something like the gitpython class can be imported and what not.
Just sharing my thoughts! Does not mean everything I say is right or wrong.
@wahlman.j I believe your heart is in the right place wrt plex and you mean well but make a list for yourself of what all needs to be installed/available/dependencies for anything that you are going to create or have created. Then think about the end user and see if they would want to take the trouble. Umm, would your webconnect feature be a possibility, after remotely logging into plex. You do get to look at PMS once you log in remotely from a client, no why not play with PlexConnect from there?
Regarding updating, why have a remote in a browser when I'm sitting in front of my TV screen. I like the aTV remote ;) I'd rather just use that and let my machine do all the work at the backend, why not the TV screen as a front end?
I however get your argument, about all modern stuff having a frontend using CGI. It’s just not the route I would take.
My philosophy is the more user friendly, cross platform compatible the more a product is used and gains popularity over time. Yes, that involves more effort by the devs, for sure. If it were that easy everyone would be doing it.
I suspect most people are just happy PlexConnect works and use PlexConnect and don't even update because it's too much trouble, while the devs continuously work hard at cosmetic and other changes. There must be a core architect at plex who can think of a design for PlexConnect that can help end users update with minimal dependencies. The priority this would take is another matter entirely.