sync updates

This commit is contained in:
Luke Pulverenti 2015-02-04 22:01:37 -05:00
parent d89b860b40
commit 9c599a3c5c
7 changed files with 62 additions and 13 deletions

View File

@ -778,7 +778,7 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
@media all and (min-width: 750px) {
.detailPageContent {
max-width: 1000px;
max-width: 950px;
width: auto;
}
}

View File

@ -13,8 +13,8 @@
<a href="livetvtimers.html">${TabScheduled}</a>
<a href="livetvseriestimers.html">${TabSeries}</a>
</div>
<div id="itemBackdrop" class="itemBackdrop noBackdrop">
<div class="itemBackdropContent">
<div style="padding: 1em 0;">
<div>
<table class="detailPageContent primaryDetailPageContent">
<tr>
<td style="vertical-align: top; padding: 0 1em 0 0;">

View File

@ -421,7 +421,7 @@
html += '<div>';
html += '<h1 style="display:inline-block; vertical-align:middle;" class="' + cssClass + '">' + Globalize.translate('HeaderLatestTvRecordings') + '</h1>';
html += '<a href="livetvrecordings.html?context=livetv" data-role="button" data-icon="arrow-r" data-mini="true" data-inline="true" data-iconpos="notext" class="sectionHeaderButton">d</a>';
html += '<a href="livetvrecordings.html?context=livetv" data-role="button" data-icon="arrow-r" data-mini="true" data-inline="true" data-iconpos="notext" class="sectionHeaderButton"></a>';
html += '</div>';
}
@ -437,7 +437,7 @@
lazy: true
});
elem.html(html).lazyChildren();
elem.html(html).lazyChildren().trigger('create');
});
}

View File

@ -224,6 +224,10 @@
return false;
}
if (itemType == "Program") {
return false;
}
if (itemType == "MusicGenre" || itemType == "Season" || itemType == "Series" || itemType == "BoxSet" || itemType == "MusicAlbum" || itemType == "MusicArtist" || itemType == "Playlist") {
return true;
}

View File

@ -83,14 +83,17 @@
else if (job.Status == 'Queued') {
background = 'rgba(51, 136, 204, ' + opacity + ')';
}
else if (job.Status == 'ReadyToTransfer') {
background = 'rgba(51, 136, 204, ' + opacity + ')';
}
else if (job.Status == 'Transferring') {
background = 'rgba(72, 0, 255, ' + opacity + ')';
}
else if (job.Status == 'Converting') {
background = 'rgba(72, 0, 255, ' + opacity + ')';
background = 'rgba(255, 106, 0, ' + opacity + ')';
}
html += '<div class="syncStatusBanner" style="background-color:' + background + ';position:absolute;top:0;right:0;padding:.5em .5em; text-align:left;color: #fff; font-weight: 500; text-transform:uppercase;">';
html += '<div class="syncStatusBanner" style="background-color:' + background + ';position:absolute;top:0;right:0;padding:.5em .5em; text-align:left;color: #fff; font-weight: 500; text-transform:uppercase; border-bottom-left-radius: 3px;">';
html += text;
html += '</div>';
@ -288,7 +291,7 @@
function stopListening() {
if (ApiClient.isWebSocketOpen()) {
ApiClient.sendWebSocketMessage("SyncJobsStart", "0,1500");
ApiClient.sendWebSocketMessage("SyncJobsStop", "");
}
}

View File

@ -76,7 +76,7 @@
html += '<li class="' + cssClass + '"' + ' data-itemid="' + jobItem.Id + '" data-status="' + jobItem.Status + '" data-remove="' + jobItem.IsMarkedForRemoval + '">';
var hasActions = ['Queued', 'Cancelled', 'Failed', 'Transferring', 'Converting', 'Synced'].indexOf(jobItem.Status) != -1;
var hasActions = ['Queued', 'Cancelled', 'Failed', 'ReadyToTransfer', 'Transferring', 'Converting', 'Synced'].indexOf(jobItem.Status) != -1;
html += '<a href="#">';
@ -181,7 +181,7 @@
else if (status == 'Cancelled') {
html += '<li data-icon="check"><a href="#" class="btnRetryJobItem" data-id="' + id + '">' + Globalize.translate('ButtonReenable') + '</a></li>';
}
else if (status == 'Queued' || status == 'Transferring' || status == 'Converting') {
else if (status == 'Queued' || status == 'Transferring' || status == 'Converting' || status == 'ReadyToTransfer') {
html += '<li data-icon="delete"><a href="#" class="btnCancelJobItem" data-id="' + id + '">' + Globalize.translate('ButtonCancelItem') + '</a></li>';
}
else if (status == 'Synced' && remove) {
@ -301,6 +301,7 @@
$('#txtTargetName', page).val(targetName);
}
var _jobOptions;
function loadJob(page) {
Dashboard.showLoadingMsg();
@ -318,6 +319,7 @@
})).done(function (options) {
_jobOptions = options;
renderJob(page, job, options);
Dashboard.hideLoadingMsg();
});
@ -335,6 +337,13 @@
});
}
function loadJobInfo(page, job, jobItems) {
renderJob(page, job, _jobOptions);
renderJobItems(page, jobItems);
Dashboard.hideLoadingMsg();
}
function saveJob(page) {
Dashboard.showLoadingMsg();
@ -364,16 +373,49 @@
}
function onWebSocketMessage(e, msg) {
var page = $.mobile.activePage;
if (msg.MessageType == "SyncJob") {
loadJobInfo(page, msg.Data.Job, msg.Data.JobItems);
}
}
function startListening(page) {
var startParams = "0,1500";
startParams += "," + getParameterByName('id');
if (ApiClient.isWebSocketOpen()) {
ApiClient.sendWebSocketMessage("SyncJobStart", startParams);
}
}
function stopListening() {
if (ApiClient.isWebSocketOpen()) {
ApiClient.sendWebSocketMessage("SyncJobStop", "");
}
}
$(document).on('pageshow', ".syncJobPage", function () {
var page = this;
loadJob(page);
}).on('pageinit', ".syncJobPage", function () {
startListening(page);
$(ApiClient).on("websocketmessage.syncJobPage", onWebSocketMessage);
}).on('pagehide', ".syncJobPage", function () {
var page = this;
stopListening();
$(ApiClient).off(".syncJobPage");
});
window.SyncJobPage = {

View File

@ -14,7 +14,7 @@
<a href="syncsettings.html" data-role="button">${TabSettings}</a>
</div>
<div style="text-align:right;margin-top:-40px;">
<div style="text-align:right;margin-top:-30px;">
<button type="button" class="btnSync" data-icon="cloud" data-mini="true" data-inline="true">${ButtonConvertMedia}</button>
<progress max="100" min="0" style="width:100px;display:none;" class="syncProgress"></progress>
</div>