Kodi Community Forum
Maraschino (formerly HTPC Frontend) - a summary web interface for your XBMC HTPC - 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: Maraschino (formerly HTPC Frontend) - a summary web interface for your XBMC HTPC (/showthread.php?tid=113136)



- HarryRosen - 2011-11-09

Is it possible to have an option to setup mutliple machines under the server settings, like I have 3 xbmc running in my place, would be nice to have the currently playing show for each one. It works now if i change the server IP to the other machine and it picks up properly but it would be nice to be able to to mutiple. Just a thought since it can be the ultimate interface to control your entire household if you have mutiple machines.

on a side note, i don't know if this would be possible to maybe port this to unraid, but don't know if you can install all the modules on a unraid box, might have to get a spare unraid box up and running to test it out. That would help with the idea of a central control hub


- mrkipling - 2011-11-09

HarryRosen Wrote:I am running that method, it's the same as dejavu posted a while back, so much easier even though I have both running now

It's a bit different as uses CherryPy's nice, stable server instead of Flask's development server which is prone to crashing quite a bit. Glad you found it easy to set up.

HarryRosen Wrote:Is it possible to have an option to setup mutliple machines under the server settings, like I have 3 xbmc running in my place, would be nice to have the currently playing show for each one. It works now if i change the server IP to the other machine and it picks up properly but it would be nice to be able to to mutiple. Just a thought since it can be the ultimate interface to control your entire household if you have mutiple machines.

Not currently, but that would be pretty sweet. I'll have a think about a nice way to support multiple XBMC installations (perhaps a quick/easy way to switch between them might work well).

HarryRosen Wrote:on a side note, i don't know if this would be possible to maybe port this to unraid, but don't know if you can install all the modules on a unraid box, might have to get a spare unraid box up and running to test it out. That would help with the idea of a central control hub

I've don't know much (anything) about unRAID so can't comment unfortunately (it looks pretty cool though).


- mrkipling - 2011-11-09

DejaVu Wrote:I dont want to throw a spanner in the works for the Disk Space module. But I found this and thought it might be relevant.

http://stackoverflow.com/questions/51658/cross-platform-space-remaining-on-volume-using-python

Thanks... I don't have Windows though so can't test it. Need to get a VM up and running or something!

DejaVu Wrote:Also, seeing as how easy this is to setup Big Grin
Is it worth making an auto Git Clone updater thingy so files get replaced without the end using breaking bits?
I realised that everything is in maraschino.db and it seems this is the only thing that needs to be backed up on a reinstall. Unless further things need to be added into it from the setup.py file in the future.

You mean like SickBeard's swish notification / click-to-update when there are new commits? Interesting... Smile


- mrkipling - 2011-11-09

I've just pushed the disk space module to the master branch. To use it, pull the latest version from the git repository and run setup.py again (it creates a new table in the database):

Code:
cd /path/to/maraschino
sudo git pull
sudo python setup.py

The module currently only works on Linux-based machines as I need to get Windows up and running. Of course, if any Windows Python developers want to have a crack at it then be my guest!

It should be fairly self-explantory - you click "add disk", and then enter the path (e.g. "/dev/sdb1").


- HarryRosen - 2011-11-09

I get this when i am trying to pull, prolly because I have extra images

error: Untracked working tree file 'static/images/applications/CouchPotato.png' would be overwritten by merge. Aborting

Nevermind I see why it's because you added the icons yourself so just deleted mine and redid the pull


- rupert - 2011-11-09

mrkipling Wrote:Not currently, but that would be pretty sweet. I'll have a think about a nice way to support multiple XBMC installations (perhaps a quick/easy way to switch between them might work well).

I haven't tried this since the configuration database was introduced & maybe that throws a wrench into this idea, but my original thought had been that I would be running separate instances of the site for each of my XBMC instance....then just add a link to the other instance(s) as another app like you did with sabnzb's or sickbeard's web interface.

I'm thinking switching XBMC instances within the code might become unnecessarily complex when just having a different apache/cherrypy site would work just as well.

Just a thought,


- DejaVu - 2011-11-09

HarryRosen Wrote:I get this when i am trying to pull, prolly because I have extra images

error: Untracked working tree file 'static/images/applications/CouchPotato.png' would be overwritten by merge. Aborting

Nevermind I see why it's because you added the icons yourself so just deleted mine and redid the pull

Use Force instead. All files are forced to be overwritten. That file has been added to the Repo since your last clone so no need to worry. Wink
Code:
cd /path/to/maraschino
sudo git pull -f
sudo python setup.py



- snoopy1492 - 2011-11-09

I made some change to the files to get a full timer while playing and not seconds changing every time we make a request to xbmc.

Unfortunately, git doesn't work on my f****ng Ubuntu (tried everything...) so I will post the changes below and if someone likes them, he can add them to git.

It may not be the best way to do that, I'm not a python/flask programmer so excuse me if it's not perfect Smile But it's a start.

Changes :
In index.js under static/js add to the top (before document.ready ) :
Code:
var h;
var m;
var s;
var t;

function setclock(timer){

var time_elem = timer.split(':');

if(time_elem[2]){
h= parseInt(time_elem[0],10);
m = parseInt(time_elem[1],10);
s = parseInt(time_elem[2],10);
}
else{
h= 0;
m = parseInt(time_elem[0],10);
s = parseInt(time_elem[1],10);
}

maj_time();
}



function maj_time(){
if (s<59){
s++;
} else {
if(m<59){
m++;
}
else {
h++;
m=0;
}
s=0;
}
if(s<10) seconds='0' + s; else seconds=s
if(m<10) minutes='0'+ m;else minutes = m;
if(h<10) hours='0' + h;else hours = h;

if(h!='00'){
new_time = hours + ':' + minutes + ':' + seconds;
} else {
new_time = minutes + ':' + seconds;
}


$(".current").text(new_time);
t=setTimeout("maj_time()",1000);
}

then still in index.js search for play/pause control and modify :
Code:
// play/pause control

  $('#currently_playing .controls .play_pause').live('click', function() {
    $.get('/xhr/controls/play_pause'[b],function(data){
if(data.success==0) clearTimeout(t);}
);[/b]

  });

  // stop control

  $('#currently_playing .controls .stop').live('click', function() {
    $.get('/xhr/controls/stop');
    [b]clearTimeout(t);[/b]
  });

Now in currently_playing.py around the end request the speed property:
Code:
time = xbmc.Player.GetProperties(playerid=1, properties=['time', 'totaltime', 'position', 'percentage', [b]'speed'[/b]])

    return render_template('currently_playing.html',
        currently_playing = currently_playing,
        fanart = fanart,
        time = time,
        current_time = format_time(time['time']),
        total_time = format_time(time['totaltime']),
        percentage_progress = int(time['percentage']),
    [b]speed = int(time['speed']),[/b]
    )

In control.py at the end modify :

Code:
if command == 'play_pause':
        xbmc.Player.PlayPause(playerid=1)
    [b]playing = xbmc.Player.GetProperties(playerid=1, properties=['speed'])
    running = int(playing['speed'])[/b]
    elif command == 'stop':
        xbmc.Player.Stop(playerid=1)

   return jsonify({ [b]'success': running [/b]})

and finnaly in currently_playing.html under template at line 27 add :
Code:
<script type="text/javascript"> clearTimeout(t);</script>
{% if speed==1 %}<script type="text/javascript">setclock('{{ current_time }}');</script>{% endif %}

That's it! So basicaly I pass the current_time to a javascript which will increment it until we get a new value from xbmc (every 4-5 seconds). It will stop if you press play/pause also (depending if it's a play or a pause^^). And stop if you stop of course Smile

Hope you like it! Smile

Next work : possibility to seek!


- Aenima99x - 2011-11-09

Anyone have this working with a reverse proxy? All other apps using a reverse proxy work fine (CouchPotato, SAB, SickBeard, HeadPhones etc)

It works fine on my internal network
Image


and here's how it looks from external
Image


- mybrain87 - 2011-11-09

OMG this is becoming such a great project.

@mrkipling: In your cherrypy Instruction is a typo:

Copy initd to /etc/init.d:
cp /home/yourusername/.masraschino/initd /etc/init.d/maraschino

should be
cp /home/yourusername/.maraschino/initd /etc/init.d/maraschino


- mrkipling - 2011-11-09

rupert Wrote:I'm thinking switching XBMC instances within the code might become unnecessarily complex when just having a different apache/cherrypy site would work just as well.

Yep, that's a valid point. Then again it would be nicer to just have one Maraschino installation for everything. Changing the code to support this shouldn't be too difficult, perhaps half a day's work - the bigger challenge would be finding a nice way to make this fit into the UI that doesn't feel "tacked on", so to speak.

One to think about, although perhaps not super-high priority right now.


- mrkipling - 2011-11-09

snoopy1492 Wrote:I made some change to the files to get a full timer while playing and not seconds changing every time we make a request to xbmc.

Thanks for the suggestion! Not entirely sure that's the best way to go with this though, as estimating the time is fraught with problems (e.g. what if somebody changes the position using XBMC itself or the Android app).

The fact that the timer only updates every 5 seconds is a mild annoyance, sure, but I prefer the fact that the data is up-to-date and reliable. Plus, if that method is good enough for AWX (a fantastic app, I'm sure you'll agree) then it's good enough for me Smile


- mrkipling - 2011-11-09

mybrain87 Wrote:OMG this is becoming such a great project.

@mrkipling: In your cherrypy Instruction is a typo:

Copy initd to /etc/init.d:
cp /home/yourusername/.masraschino/initd /etc/init.d/maraschino

should be
cp /home/yourusername/.maraschino/initd /etc/init.d/maraschino

Thanks, both for the support and the head-up re. the typo! I'll fix it now.


- Archigos - 2011-11-09

First off, sweet job MrKipling...

Like Deja, I was one that worked on MFP (granted I did SOO much less then he did) and decided to try this out. It's an awesome replacement and you've made great advances in a short amount of time. A few days ago when I found this project it took me a few hours of screwing around to get it to run on Linux Mint 11 (Katya x64) and couldn't for the life of me get it to run on my Windows Server. Since Linux is a secondary OS on my laptop which isn't always near the HTPC it was cool in the 'gimmicky' fashion. So I decided to give it another and downloaded a fresh copy from Git about 20 minutes ago and managed to get it running on my IIS Server in under a minute...

Not only does it run smooth on Windows, it looks fantastic when viewed via my iPad (haven't looked on my iPhone yet), but I've noticed a few 'issues'. If I reboot my laptop to Linux and run this, the recent tv episode thumbnails work (although it asks for XBMC user/pass randomly), however on my server the thumbnails appear as small question marks. Not exactly sure why that's happening but I'll mess with it a bit later. The main reason for my post is to ask if the Hard Drive Widget is hard coded for Linux paths only since I can't figure out how to get any Windows Drives to show (they all come up with Invalid Path or something like that). I haven't configured the Applications yet since I ran into those other small problems but will report back on that shortly.

----
I'm going to create a new post after this one (in case you want to link to it) with simple instructions on getting this to run on a Windows System (tested on Windows 7 and Windows Server 2008 R2).


- snoopy1492 - 2011-11-09

mrkipling Wrote:Thanks for the suggestion! Not entirely sure that's the best way to go with this though, as estimating the time is fraught with problems (e.g. what if somebody changes the position using XBMC itself or the Android app).

The fact that the timer only updates every 5 seconds is a mild annoyance, sure, but I prefer the fact that the data is up-to-date and reliable. Plus, if that method is good enough for AWX (a fantastic app, I'm sure you'll agree) then it's good enough for me Smile

I thought of that and I still implemented it because in the worst case scenario the time will be wrong for 5 seconds then it will be corrected by the request to xbmc.

Anyway, I will still try to implement the possibility to seek Wink