We're getting our own database!

First code for independent notifications (not linked to PlexWatch).
New notifications panel in Settings (many types still untested).
Standardise the parameters sent to current activity.
Remove notifiers we cannot use.
Styling fixes for sync tables.
This commit is contained in:
Tim 2015-07-03 19:50:47 +02:00
commit 349a850451
14 changed files with 401 additions and 354 deletions

View file

@ -40,7 +40,7 @@
<ul class="nav nav-pills" role="tablist">
<li role="presentation" class="active"><a href="#tabs-1" aria-controls="tabs-1" role="tab" data-toggle="tab">Web Interface</a></li>
<li role="presentation"><a href="#tabs-2" aria-controls="tabs-2" role="tab" data-toggle="tab">Plex & PlexWatch</a></li>
<!--<li role="presentation"><a href="#tabs-5" aria-controls="tabs-5" role="tab" data-toggle="tab">Notifications</a></li>-->
<li role="presentation"><a href="#tabs-5" aria-controls="tabs-5" role="tab" data-toggle="tab">Notifications</a></li>
</ul>
<div class="tab-content">
@ -206,13 +206,13 @@
</div>
</div>
<input type="button" class="btn btn-medium btn-primary save-button" value="Save" data-success="Changes saved successfully">
</div>
<!--
<div role="tabpanel" class="tab-pane" id="tabs-5">
<div class="wellbg">
<div class="wellbg" style="padding: 0px 0px 0px 20px;">
<div class="container-fluid">
<div class="row">
<div class="col-md-4">
<div class="row-fluid">
<div class="span4">
<fieldset>
<div class="wellheader">
<h3>Growl</h3>
@ -298,17 +298,9 @@
</div>
</div>
</fieldset>
<fieldset>
<div class="wellheader">
<h3>Synology NAS</h3>
</div>
<div class="checkbox">
<input type="checkbox" name="synoindex_enabled" id="synoindex" value="1" ${config['synoindex_enabled']}> Enable Synoindex
</div>
</fieldset>
</div>
<div class="col-md-4">
<div class="span4">
<fieldset>
<div class="wellheader">
<h3>NotifyMyAndroid</h3>
@ -348,21 +340,6 @@
</div>
</div>
</fieldset>
<fieldset>
<div class="wellheader">
<h3>Logitech Media Server</h3>
</div>
<div class="checkbox">
<input type="checkbox" name="lms_enabled" id="lms" value="1" ${config['lms_enabled']}> Enable LMS Updates
</div>
<div id="lmsoptions">
<div class="form-group">
<label for="lms_host">LMS Host:Port</label>
<input type="text" id="lms_host" name="lms_host" value="${config['lms_host']}" size="30">
<p class="help-block">e.g. http://localhost:9000. Seperate hosts with commas.</p>
</div>
</div>
</fieldset>
<fieldset>
<div class="wellheader">
@ -380,28 +357,6 @@
</div>
</fieldset>
<fieldset>
<div class="wellheader">
<h3>Subsonic</h3>
</div>
<div class="checkbox">
<input type="checkbox" name="subsonic_enabled" id="subsonic" value="1" ${config['subsonic_enabled']}> Enable Subsonic Updates
</div>
<div id="subsonicoptions">
<div class="form-group">
<label for="subsonic_host">Subsonic URL</label>
<input type="text" id="subsonic_host" name="subsonic_host" value="${config['subsonic_host']}" size="30">
</div>
<div class="form-group">
<label for="subsonic_username">Subsonic Username</label>
<input type="text" id="subsonic_username" name="subsonic_username" value="${config['subsonic_username']}" size="30">
</div>
<div class="form-group">
<label for="subsonic_password">Subsonic Password</label>
<input type="password" id="subsonic_password" name="subsonic_password" value="${config['subsonic_password']}" size="30">
</div>
</div>
</fieldset>
<fieldset>
<div class="wellheader">
<h3>Email</h3>
@ -441,7 +396,7 @@
</fieldset>
</div>
<div class="md-col-4">
<div class="span4">
<fieldset>
<div class="wellheader">
<h3>Pushover</h3>
@ -484,6 +439,7 @@
</div>
</fieldset>
<!-- We need to test Twitter first
<fieldset>
<div class="wellheader">
<h3>Twitter</h3>
@ -504,7 +460,7 @@
</div>
</div>
</fieldset>
-->
<fieldset>
<div class="wellheader">
<h3>OS X</h3>
@ -537,22 +493,13 @@
</div>
</fieldset>
<fieldset>
<div class="wellheader">
<h3>MPC</h3>
</div>
<div class="checkbox">
<input type="checkbox" name="mpc_enabled" id="mpc" value="1" ${config['mpc_enabled']}> Enable MPC Update
</div>
</fieldset>
</div>
</div>
</div>
<br/>
</div>
<input type="button" class="btn btn-medium btn-primary" value="Save" onclick="doAjaxCall('configUpdate',$(this),'tabs',true);return false;" data-success="Changes saved successfully">
<input type="button" class="btn btn-medium btn-primary save-button" value="Save" data-success="Changes saved successfully">
</div>
-->
</div>
</div>
</form>
@ -885,26 +832,6 @@
}
});
if ($("#lms").is(":checked"))
{
$("#lmsoptions").show();
}
else
{
$("#lmsoptions").hide();
}
$("#lms").click(function(){
if ($("#lms").is(":checked"))
{
$("#lmsoptions").slideDown();
}
else
{
$("#lmsoptions").slideUp();
}
});
if ($("#plex").is(":checked"))
{
$("#plexoptions").show();
@ -1066,26 +993,6 @@
}
});
if ($("#subsonic").is(":checked"))
{
$("#subsonicoptions").show();
}
else
{
$("#subsonicoptions").hide();
}
$("#subsonic").click(function(){
if ($("#subsonic").is(":checked"))
{
$("#subsonicoptions").slideDown();
}
else
{
$("#subsonicoptions").slideUp();
}
});
if ($("#email").is(":checked"))
{
$("#email_options").show();

View file

@ -29,13 +29,8 @@ player Returns the name of the platform used to play the stream
audioDecision Returns the audio transcode decision. Either 'transcode', 'copy' or 'direct play'.
audioCodec Returns the name of the audio codec.
audioChannels Returns the number of audio channels.
== Only if 'type' is 'episode' ==
grandparentTitle Returns the name of the TV Show.
== Only if 'type' is 'track' ==
artist Returns the name of the artist of a music track.
album Returns the name of the album of the music track.
grandparentTitle Returns the title of the item's grandparent.
parentTitle Returns the title of the item's parent.
== Only if 'type' is 'episode' or 'movie' ==
videoDecision Returns the video transcode decision. Either 'transcode', 'copy' or 'direct play'.
@ -83,7 +78,7 @@ DOCUMENTATION :: END
% elif a['type'] == 'movie':
<a href="info?rating_key=${a['ratingKey']}">${a['title']}</a>
% elif a['type'] == 'track':
${a['artist']} - ${a['track']}
${a['grandparentTitle']} - ${a['title']}
% else:
${a['grandparentTitle']} - ${a['title']}
% endif
@ -93,9 +88,9 @@ DOCUMENTATION :: END
<div class='dashboard-activity-info-details-overlay'>
<div class='dashboard-activity-info-details-content'>
% if a['type'] == 'track':
Artist: <strong>${a['artist']}</strong>
Artist: <strong>${a['grandparentTitle']}</strong>
<br>
Album: <strong>${a['album']}</strong>
Album: <strong>${a['parentTitle']}</strong>
<br>
% endif
% if a['state'] == 'playing':

View file

@ -28,7 +28,8 @@ sync_table_options = {
} else {
$(td).html(cellData.toProperCase());
}
}
},
"className": "no-wrap"
},
{
"targets": [1],
@ -37,7 +38,8 @@ sync_table_options = {
if (cellData !== '') {
$(td).html('<a href="user?user=' + rowData['username'] + '">' + cellData + '</a>');
}
}
},
"className": "no-wrap"
},
{
"targets": [2],
@ -57,15 +59,18 @@ sync_table_options = {
"data": "metadata_type",
"render": function ( data, type, full ) {
return data.toProperCase();
}
},
"className": "no-wrap"
},
{
"targets": [4],
"data": "device_name"
"data": "device_name",
"className": "no-wrap"
},
{
"targets": [5],
"data": "platform"
"data": "platform",
"className": "no-wrap"
},
{
"targets": [6],
@ -77,19 +82,23 @@ sync_table_options = {
} else {
$(td).html('0MB');
}
}
},
"className": "no-wrap"
},
{
"targets": [7],
"data": "item_count"
"data": "item_count",
"className": "no-wrap"
},
{
"targets": [8],
"data": "item_complete_count"
"data": "item_complete_count",
"className": "no-wrap"
},
{
"targets": [9],
"data": "item_downloaded_count"
"data": "item_downloaded_count",
"className": "no-wrap"
},
{
"targets": [10],
@ -100,7 +109,8 @@ sync_table_options = {
} else {
$(td).html('<span class="badge">0%</span>');
}
}
},
"className": "no-wrap"
}
],
"drawCallback": function (settings) {

View file

@ -33,17 +33,17 @@ from plexpy import helpers
<table class="display" id="sync_table" width="100%">
<thead>
<tr>
<th align='left' id="state">State</th>
<th align='left' id="username">Username</th>
<th align='left' id="title">Title</th>
<th align='left' id="type">Type</th>
<th align='left' id="device">Device</th>
<th align='left' id="platform">Platform</th>
<th align='left' id="size">Total Size</th>
<th align='left' id="items">Total Items</th>
<th align='left' id="converted">Converted</th>
<th align='left' id="downloaded">Downloaded</th>
<th align='left' id="percent_complete">Complete</th>
<th class="desktop" align='left' id="state">State</th>
<th class="all" align='left' id="username">Username</th>
<th class="all" align='left' id="title">Title</th>
<th class="desktop" align='left' id="type">Type</th>
<th class="min-tablet" align='left' id="device">Device</th>
<th class="desktop" align='left' id="platform">Platform</th>
<th class="desktop" align='left' id="size">Total Size</th>
<th class="min-tablet" align='left' id="items">Total Items</th>
<th class="desktop" align='left' id="converted">Converted</th>
<th class="desktop" align='left' id="downloaded">Downloaded</th>
<th class="desktop" align='left' id="percent_complete">Complete</th>
</tr>
</thead>
<tbody>

View file

@ -222,17 +222,17 @@ from plexpy import helpers
<table class="display" id="sync_table" width="100%">
<thead>
<tr>
<th align='left' id="state">State</th>
<th align='left' id="username">Username</th>
<th align='left' id="sync_title">Title</th>
<th align='left' id="type">Type</th>
<th align='left' id="device">Device</th>
<th align='left' id="sync_platform">Platform</th>
<th align='left' id="size">Total Size</th>
<th align='left' id="items">Total Items</th>
<th align='left' id="converted">Converted</th>
<th align='left' id="downloaded">Downloaded</th>
<th align='left' id="sync_percent_complete">Complete</th>
<th class="desktop" align='left' id="state">State</th>
<th class="never" align='left' id="username">Username</th>
<th class="all" align='left' id="sync_title">Title</th>
<th class="desktop" align='left' id="type">Type</th>
<th class="all" align='left' id="device">Device</th>
<th class="desktop" align='left' id="sync_platform">Platform</th>
<th class="desktop" align='left' id="size">Total Size</th>
<th class="min-tablet" align='left' id="items">Total Items</th>
<th class="desktop" align='left' id="converted">Converted</th>
<th class="desktop" align='left' id="downloaded">Downloaded</th>
<th class="desktop" align='left' id="sync_percent_complete">Complete</th>
</tr>
</thead>
<tbody>