update channel mapper
This commit is contained in:
parent
7242460988
commit
84945cabc4
2 changed files with 43 additions and 16 deletions
|
@ -54,6 +54,7 @@
|
||||||
[is="emby-button"].fab i {
|
[is="emby-button"].fab i {
|
||||||
height: 4.4vh;
|
height: 4.4vh;
|
||||||
width: 4.4vh;
|
width: 4.4vh;
|
||||||
|
font-size: 4.4vh;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,16 +63,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
[is="emby-button"].fab.mini {
|
[is="emby-button"].fab.mini {
|
||||||
|
padding: .4em;
|
||||||
min-width: 40px !important;
|
min-width: 40px !important;
|
||||||
min-height: 40px !important;
|
min-height: 40px !important;
|
||||||
height: 3.3vh !important;
|
height: 3.3vh !important;
|
||||||
width: 3.3vh !important;
|
width: 3.3vh !important;
|
||||||
padding: .4em;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[is="emby-button"].fab.mini i {
|
[is="emby-button"].fab.mini i {
|
||||||
height: 2.6vh !important;
|
height: 2.6vh !important;
|
||||||
width: 2.6vh !important;
|
width: 2.6vh !important;
|
||||||
|
font-size: 2.6vh !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
[is="emby-button"].fab iron-icon {
|
[is="emby-button"].fab iron-icon {
|
||||||
|
@ -80,10 +82,6 @@
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
[is="emby-button"].fab i {
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
[is="emby-button"].block {
|
[is="emby-button"].block {
|
||||||
display: block;
|
display: block;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -105,7 +103,7 @@
|
||||||
margin-left: .5em;
|
margin-left: .5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
[is=emby-button].autoSize {
|
[is=emby-button].autoSize, [is=emby-button].autoSize.fab {
|
||||||
width: auto !important;
|
width: auto !important;
|
||||||
height: auto !important;
|
height: auto !important;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
define(['dialogHelper', 'loading', 'connectionManager', 'globalize', 'actionsheet', 'paper-checkbox', 'emby-input', 'paper-icon-button-light', 'emby-select', 'emby-button', 'listViewStyle', 'material-icons'],
|
define(['dialogHelper', 'loading', 'connectionManager', 'globalize', 'actionsheet', 'paper-checkbox', 'emby-input', 'paper-icon-button-light', 'emby-button', 'listViewStyle', 'material-icons'],
|
||||||
function (dialogHelper, loading, connectionManager, globalize, actionsheet) {
|
function (dialogHelper, loading, connectionManager, globalize, actionsheet) {
|
||||||
|
|
||||||
return function (options) {
|
return function (options) {
|
||||||
|
@ -20,9 +20,31 @@ function (dialogHelper, loading, connectionManager, globalize, actionsheet) {
|
||||||
return elem;
|
return elem;
|
||||||
}
|
}
|
||||||
|
|
||||||
function mapChannel(tunerChannelNumber, providerChannelNumber) {
|
function mapChannel(button, tunerChannelNumber, providerChannelNumber) {
|
||||||
|
|
||||||
alert('coming soon.');
|
loading.show();
|
||||||
|
|
||||||
|
var providerId = options.providerId;
|
||||||
|
var apiClient = connectionManager.getApiClient(options.serverId);
|
||||||
|
|
||||||
|
apiClient.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
url: ApiClient.getUrl('LiveTv/ChannelMappings'),
|
||||||
|
data: {
|
||||||
|
providerId: providerId,
|
||||||
|
tunerChannelNumber: tunerChannelNumber,
|
||||||
|
providerChannelNumber: providerChannelNumber
|
||||||
|
},
|
||||||
|
dataType: 'json'
|
||||||
|
|
||||||
|
}).then(function (mapping) {
|
||||||
|
|
||||||
|
var listItem = parentWithClass(button, 'listItem');
|
||||||
|
|
||||||
|
button.setAttribute('data-providernumber', mapping.ProviderChannelNumber);
|
||||||
|
listItem.querySelector('.secondary').innerHTML = getMappingSecondaryName(mapping, currentMappingOptions.ProviderName);
|
||||||
|
loading.hide();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onChannelsElementClick(e) {
|
function onChannelsElementClick(e) {
|
||||||
|
@ -33,14 +55,15 @@ function (dialogHelper, loading, connectionManager, globalize, actionsheet) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var channelNumber = btnMap.getAttribute('data-number');
|
var tunerChannelNumber = btnMap.getAttribute('data-number');
|
||||||
|
var providerChannelNumber = btnMap.getAttribute('data-providernumber');
|
||||||
|
|
||||||
var menuItems = currentMappingOptions.ProviderChannels.map(function (m) {
|
var menuItems = currentMappingOptions.ProviderChannels.map(function (m) {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: m.Name,
|
name: m.Name,
|
||||||
id: m.Id,
|
id: m.Id,
|
||||||
selected: m.Id == channelNumber
|
selected: m.Id.toLowerCase() == providerChannelNumber.toLowerCase()
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -49,24 +72,30 @@ function (dialogHelper, loading, connectionManager, globalize, actionsheet) {
|
||||||
items: menuItems
|
items: menuItems
|
||||||
|
|
||||||
}).then(function (newChannelNumber) {
|
}).then(function (newChannelNumber) {
|
||||||
mapChannel(channelNumber, newChannelNumber);
|
mapChannel(btnMap, tunerChannelNumber, newChannelNumber);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getChannelMappingOptions(serverId, providerId) {
|
function getChannelMappingOptions(serverId, providerId) {
|
||||||
|
|
||||||
return connectionManager.getApiClient(serverId).getJSON(ApiClient.getUrl('LiveTv/ChannelMappingOptions', {
|
var apiClient = connectionManager.getApiClient(serverId);
|
||||||
|
return apiClient.getJSON(apiClient.getUrl('LiveTv/ChannelMappingOptions', {
|
||||||
providerId: providerId
|
providerId: providerId
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getMappingSecondaryName(mapping, providerName) {
|
||||||
|
|
||||||
|
return (mapping.ProviderChannelNumber || '') + ' ' + (mapping.ProviderChannelName || '') + ' - ' + providerName;
|
||||||
|
}
|
||||||
|
|
||||||
function getTunerChannelHtml(channel, providerName) {
|
function getTunerChannelHtml(channel, providerName) {
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
|
|
||||||
html += '<div class="listItem">';
|
html += '<div class="listItem">';
|
||||||
|
|
||||||
html += '<button is="emby-button" type="button" class="fab listItemIcon mini" style="background:#52B54B;"><iron-icon icon="dvr"></iron-icon></button>';
|
html += '<button is="emby-button" type="button" class="fab autoSize mini" style="background:#52B54B;"><i class="md-icon listItemIcon">dvr</i></button>';
|
||||||
|
|
||||||
html += '<div class="listItemBody">';
|
html += '<div class="listItemBody">';
|
||||||
html += '<h3>';
|
html += '<h3>';
|
||||||
|
@ -75,13 +104,13 @@ function (dialogHelper, loading, connectionManager, globalize, actionsheet) {
|
||||||
|
|
||||||
if (channel.ProviderChannelNumber || channel.ProviderChannelName) {
|
if (channel.ProviderChannelNumber || channel.ProviderChannelName) {
|
||||||
html += '<div class="secondary">';
|
html += '<div class="secondary">';
|
||||||
html += (channel.ProviderChannelNumber || '') + ' ' + (channel.ProviderChannelName || '') + ' - ' + providerName;
|
html += getMappingSecondaryName(channel, providerName);
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
html += '<button class="btnMap" is="paper-icon-button-light" type="button" data-number="' + channel.Number + '"><iron-icon icon="mode-edit"></iron-icon></button>';
|
html += '<button class="btnMap" is="paper-icon-button-light" type="button" data-number="' + channel.Number + '" data-providernumber="' + channel.ProviderChannelNumber + '"><iron-icon icon="mode-edit"></iron-icon></button>';
|
||||||
|
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue