mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
show/hide live tv menu based on installed services
This commit is contained in:
parent
732cbeaad8
commit
66ced0ebc8
33
ApiClient.js
33
ApiClient.js
@ -378,6 +378,39 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
self.getLiveTvServices = function (options) {
|
||||||
|
|
||||||
|
var url = self.getUrl("/LiveTv/Services", options || {});
|
||||||
|
|
||||||
|
return self.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: url,
|
||||||
|
dataType: "json"
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
self.getLiveTvChannels = function (options) {
|
||||||
|
|
||||||
|
var url = self.getUrl("/LiveTv/Channels", options || {});
|
||||||
|
|
||||||
|
return self.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: url,
|
||||||
|
dataType: "json"
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
self.getLiveTvRecordings = function (options) {
|
||||||
|
|
||||||
|
var url = self.getUrl("/LiveTv/Recordings", options || {});
|
||||||
|
|
||||||
|
return self.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: url,
|
||||||
|
dataType: "json"
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the current server status
|
* Gets the current server status
|
||||||
*/
|
*/
|
||||||
|
@ -129,7 +129,7 @@
|
|||||||
|
|
||||||
.libraryViewNav a {
|
.libraryViewNav a {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: .5em .25em;
|
padding: .25em .25em;
|
||||||
color: #eee!important;
|
color: #eee!important;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
@ -486,6 +486,13 @@ a.itemTag:hover {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media all and (min-width: 750px) {
|
||||||
|
|
||||||
|
.libraryViewNav a {
|
||||||
|
padding: .5em 1em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media all and (max-width: 750px) {
|
@media all and (max-width: 750px) {
|
||||||
|
|
||||||
.itemBackdrop {
|
.itemBackdrop {
|
||||||
@ -525,10 +532,6 @@ a.itemTag:hover {
|
|||||||
.noBackdrop .lnkSibling {
|
.noBackdrop .lnkSibling {
|
||||||
bottom: 260px;
|
bottom: 260px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.libraryViewNav a {
|
|
||||||
padding: .5em 1em;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (min-width: 1000px) {
|
@media all and (min-width: 1000px) {
|
||||||
|
@ -2287,6 +2287,7 @@
|
|||||||
(function (window, document, $) {
|
(function (window, document, $) {
|
||||||
|
|
||||||
var itemCountsPromise;
|
var itemCountsPromise;
|
||||||
|
var liveTvServicesPromise;
|
||||||
|
|
||||||
function renderHeader(page, user) {
|
function renderHeader(page, user) {
|
||||||
|
|
||||||
@ -2330,7 +2331,7 @@
|
|||||||
Search.onSearchRendered($('.viewMenuBar', page));
|
Search.onSearchRendered($('.viewMenuBar', page));
|
||||||
}
|
}
|
||||||
|
|
||||||
function insertViews(page, user, counts) {
|
function insertViews(page, user, counts, liveTvServices) {
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
|
|
||||||
@ -2352,7 +2353,7 @@
|
|||||||
viewCount++;
|
viewCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (false) {
|
if (liveTvServices.length) {
|
||||||
html += '<a class="viewMenuLink viewMenuTextLink' + (view == 'livetv' ? selectedCssClass : '') + '" href="livetvchannels.html">' + (view == 'livetv' ? selectedHtml : '') + '<span class="viewName">Live TV</span></a>';
|
html += '<a class="viewMenuLink viewMenuTextLink' + (view == 'livetv' ? selectedCssClass : '') + '" href="livetvchannels.html">' + (view == 'livetv' ? selectedHtml : '') + '<span class="viewName">Live TV</span></a>';
|
||||||
viewCount++;
|
viewCount++;
|
||||||
}
|
}
|
||||||
@ -2383,10 +2384,16 @@
|
|||||||
renderHeader(page, user);
|
renderHeader(page, user);
|
||||||
|
|
||||||
itemCountsPromise = itemCountsPromise || ApiClient.getItemCounts(Dashboard.getCurrentUserId());
|
itemCountsPromise = itemCountsPromise || ApiClient.getItemCounts(Dashboard.getCurrentUserId());
|
||||||
|
liveTvServicesPromise = liveTvServicesPromise || ApiClient.getLiveTvServices();
|
||||||
|
|
||||||
|
$.when(itemCountsPromise, liveTvServicesPromise).done(function (response1, response2) {
|
||||||
|
|
||||||
|
var counts = response1[0];
|
||||||
|
var liveTvServices = response2[0];
|
||||||
|
|
||||||
|
insertViews(page, user, counts, liveTvServices);
|
||||||
|
|
||||||
itemCountsPromise.done(function (counts) {
|
|
||||||
|
|
||||||
insertViews(page, user, counts);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.192" targetFramework="net45" />
|
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.193" targetFramework="net45" />
|
||||||
<package id="ServiceStack.Common" version="3.9.62" targetFramework="net45" />
|
<package id="ServiceStack.Common" version="3.9.62" targetFramework="net45" />
|
||||||
<package id="ServiceStack.Text" version="3.9.62" targetFramework="net45" />
|
<package id="ServiceStack.Text" version="3.9.62" targetFramework="net45" />
|
||||||
</packages>
|
</packages>
|
Loading…
Reference in New Issue
Block a user