add more report data

This commit is contained in:
Luke Pulverenti 2014-03-03 23:53:48 -05:00
parent 8a5c833522
commit a7b5b2663e
9 changed files with 479 additions and 231 deletions

View File

@ -11,7 +11,7 @@
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="#" data-role="button" class="ui-btn-active">General</a>
<a href="advancedserversettings.html" data-role="button">Http Server</a>
<a href="advancedserversettings.html" data-role="button">Server</a>
<a href="encodingsettings.html" data-role="button">Transcoding</a>
</div>
<form id="advancedConfigurationForm">

View File

@ -11,7 +11,7 @@
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="advanced.html" data-role="button">General</a>
<a href="#" data-role="button" class="ui-btn-active">Http Server</a>
<a href="#" data-role="button" class="ui-btn-active">Server</a>
<a href="encodingsettings.html" data-role="button">Transcoding</a>
</div>
<form class="advancedServerSettingsForm">

View File

@ -162,6 +162,10 @@
background-color: transparent !important;
}
.clearLibraryReportIndicator {
background-color: transparent !important;
}
.editorTile {
display: inline-block;
margin: 5px;
@ -199,7 +203,8 @@
}
.tblLibraryReport img {
height: 20px;
height: 18px;
margin-right: 10px;
}
@media all and (min-width: 600px) {

View File

@ -253,7 +253,7 @@ h1 .imageLink {
color: #fff!important;
text-shadow: none!important;
font-weight: 400!important;
font-size: 15px;
font-size: 14px;
}
.sidebarLinks a:hover {
@ -268,7 +268,7 @@ h1 .imageLink {
.sidebarDivider {
height: 1px;
background: #444;
background: #404040;
margin: .25em 0;
}

View File

@ -11,7 +11,7 @@
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="advanced.html" data-role="button">General</a>
<a href="advancedserversettings.html" data-role="button">Http Server</a>
<a href="advancedserversettings.html" data-role="button">Server</a>
<a href="#" data-role="button" class="ui-btn-active">Transcoding</a>
</div>

View File

@ -18,6 +18,7 @@
<div style="text-align: center;">
<div class="viewControls">
<span style="margin-right: 10px; vertical-align: middle;">Report:</span>
<div style="display: inline-block;">
<select data-mini="true" data-inline="true" id="selectView" name="selectView">
<option value="AdultVideo">Adult Videos</option>
@ -31,6 +32,7 @@
<option value="Movie">Movies</option>
<option value="MusicVideo">Music Videos</option>
<option value="Trailer">Trailers</option>
<option value="Season">Seasons</option>
<option value="Series">Series</option>
<option value="Audio">Songs</option>
</select>
@ -40,26 +42,8 @@
<div class="listTopPaging">
</div>
</div>
<table data-role="table" data-mode="reflow" class="tblLibraryReport detailTable stripedTable ui-responsive table-stroke" style="display: table;">
<thead>
<tr>
<th data-priority="1"></th>
<th data-priority="1" class="thParent">Parent</th>
<th data-priority="1">Name</th>
<th data-priority="1">Date Added</th>
<th data-priority="1">Release Date</th>
<th data-priority="1">Rating</th>
<th data-priority="1">Runtime</th>
<th data-priority="1" class="thPlayers">Players</th>
<th data-priority="1">Codecs</th>
<th data-priority="1" class="thSubtitles">Subtitles</th>
<th data-priority="1">Features</th>
</tr>
</thead>
<tbody class="resultBody">
</tbody>
</table>
<br />
<div class="reportContainer"></div>
<div class="listBottomPaging">
</div>
@ -99,6 +83,20 @@
<input class="chk3DFilter" type="checkbox" name="chk3D" id="chk3D" data-filter="Digital3D,Sbs3D" data-mini="true">
<label for="chk3D">3D</label>
<input class="chkIsPlaceHolder" type="checkbox" id="chkIsPlaceHolder" data-mini="true">
<label for="chkIsPlaceHolder">Stub</label>
</fieldset>
<br />
<fieldset data-role="controlgroup">
<legend>
<strong>Episodes:</strong>
</legend>
<input type="checkbox" name="chkSpecialEpisode" id="chkSpecialEpisode" data-mini="true">
<label for="chkSpecialEpisode">Season 0</label>
<input type="checkbox" name="chkMissingEpisode" id="chkMissingEpisode" data-mini="true">
<label for="chkMissingEpisode">Missing Episode</label>
</fieldset>
</div>
@ -115,6 +113,9 @@
<input class="chkMissingOverview" type="checkbox" name="chkMissingOverview" id="chkMissingOverview" data-mini="true">
<label for="chkMissingOverview">Missing Overview</label>
<input class="chkMissingRating" type="checkbox" name="chkMissingRating" id="chkMissingRating" data-mini="true">
<label for="chkMissingRating">Missing Rating</label>
<input class="chkIsUnidentified" type="checkbox" id="chkIsUnidentified" data-mini="true">
<label for="chkIsUnidentified">Unidentified</label>

View File

@ -1363,7 +1363,7 @@
html += '<div class="listPaging">';
html += '<span style="margin-right: 10px;">';
html += '<span style="margin-right: 10px;vertical-align:middle;">';
var startAtDisplay = totalRecordCount ? query.StartIndex + 1 : 0;
html += startAtDisplay + '-' + recordsEnd + ' of ' + totalRecordCount;

View File

@ -6,187 +6,417 @@
SortBy: "SeriesSortName,SortName",
SortOrder: "Ascending",
Recursive: true,
Fields: "MediaStreams,DateCreated,Settings",
Fields: "MediaStreams,DateCreated,Settings,Studios",
StartIndex: 0,
IncludeItemTypes: "Movie"
IncludeItemTypes: "Movie",
IsMissing: false,
IsVirtualUnaired: false
};
function getCodecName(stream) {
function getHeaderCells(reportType) {
var val = stream.Codec || '';
val = val.toUpperCase();
switch (reportType) {
if (val == 'DCA') {
return stream.Profile;
case 'Season':
{
return [
{},
{ name: 'Series' },
{ name: 'Season' },
{ name: 'Date Added' }
];
}
case 'Series':
{
return [
{},
{ name: 'Name' },
{ name: 'Network' },
{ name: 'Date Added' },
{ name: 'Year' },
{ name: 'Rating' },
{ name: 'Runtime' },
{ name: 'Trailers' },
{ name: 'Specials' }
];
}
case 'Game':
{
return [
{},
{ name: 'Name' },
{ name: 'Game System' },
{ name: 'Date Added' },
{ name: 'Release Date' },
{ name: 'Rating' },
{ name: 'Players' },
{ name: 'Trailers' }
];
}
case 'Audio':
{
return [
{},
{ name: 'Album Artist' },
{ name: 'Album' },
{ name: 'Track' },
{ name: 'Name' },
{ name: 'Date Added' },
{ name: 'Release Date' },
{ name: 'Runtime' },
{ name: 'Audio' },
{ name: 'Embedded Image' }
];
}
case 'Episode':
{
return [
{},
{ name: 'Series' },
{ name: 'Season' },
{ name: 'Name' },
{ name: 'Date Added' },
{ name: 'Release Date' },
{ name: 'Runtime' },
{ name: 'Video' },
{ name: 'Audio' },
{ name: 'Subtitles' }
];
}
case 'BoxSet':
{
return [
{},
{ name: 'Name' },
{ name: 'Date Added' },
{ name: 'Release Date' },
{ name: 'Rating' },
{ name: 'Trailers' }
];
}
case 'Book':
{
return [
{},
{ name: 'Series' },
{ name: 'Name' },
{ name: 'Date Added' },
{ name: 'Release Date' },
{ name: 'Rating' }
];
}
case 'MusicArtist':
{
return [
{},
{ name: 'Name' },
{ name: 'Date Added' }
];
}
case 'MusicAlbum':
{
return [
{},
{ name: 'Album Artist' },
{ name: 'Name' },
{ name: 'Date Added' },
{ name: 'Release Date' },
{ name: 'Rating' },
{ name: 'Runtime' }
];
}
default:
{
return [
{},
{ name: 'Name' },
{ name: 'Date Added' },
{ name: 'Release Date' },
{ name: 'Rating' },
{ name: 'Runtime' },
{ name: 'Video' },
{ name: 'Audio' },
{ name: 'Subtitles' },
{ name: 'Trailers' },
{ name: 'Specials' }
];
}
}
return val;
}
function getTableRowsHtml(items, includeParentInfo, includeSubtitles, includePlayers) {
function getItemCellsHtml(item, headercells) {
return headercells.map(function (cell) {
var html = '';
html += '<td>';
switch (cell.type || cell.name) {
case 'Album Artist':
{
html += item.AlbumArtist || '&nbsp;';
break;
}
case 'Album':
{
html += item.Album || '&nbsp;';
break;
}
case 'Series':
{
html += item.SeriesName || '&nbsp;';
break;
}
case 'Game System':
{
html += item.GameSystem || '&nbsp;';
break;
}
case 'Network':
{
html += item.Studios.length ? item.Studios[0].Name : '&nbsp;';
break;
}
case 'Track':
{
html += item.IndexNumber == null ? '' : item.IndexNumber;
break;
}
case 'Players':
{
html += item.Players || '&nbsp;';
break;
}
case 'Audio':
{
var stream = (item.MediaStreams || []).filter(function (s) {
return s.Type == 'Audio';
})[0];
if (stream) {
var name = (stream.Codec || '').toUpperCase();
html += name == 'DCA' ? (stream.Profile || '').toUpperCase() : name;
}
break;
}
case 'Video':
{
var stream = (item.MediaStreams || []).filter(function (s) {
return s.Type == 'Video';
})[0];
if (stream) {
html += (stream.Codec || '').toUpperCase();
}
break;
}
case 'Embedded Image':
{
if ((item.MediaStreams || []).filter(function (s) {
return s.Type == 'Video';
}).length) {
html += '<div class="libraryReportIndicator clearLibraryReportIndicator"><div class="ui-icon-check ui-btn-icon-notext"></div></div>';
}
break;
}
case 'Subtitles':
{
var hasSubtitles = (item.MediaStreams || []).filter(function (s) {
return s.Type == 'Subtitle';
}).length;
if (hasSubtitles) {
html += '<div class="libraryReportIndicator clearLibraryReportIndicator"><div class="ui-icon-check ui-btn-icon-notext"></div></div>';
}
break;
}
case 'Runtime':
{
if (item.RunTimeTicks) {
html += Dashboard.getDisplayTime(item.RunTimeTicks);
} else {
html += '&nbsp;';
}
break;
}
case 'Trailers':
{
if (item.LocalTrailerCount) {
html += '<div class="libraryReportIndicator clearLibraryReportIndicator"><div class="ui-icon-check ui-btn-icon-notext"></div></div>';
}
break;
}
case 'Specials':
{
if (item.SpecialFeatureCount) {
html += '<div class="libraryReportIndicator clearLibraryReportIndicator"><div class="ui-icon-check ui-btn-icon-notext"></div></div>';
}
break;
}
case 'Season':
{
if (item.Type == "Episode") {
html += item.ParentIndexNumber == null ? '' : ('Season ' + item.ParentIndexNumber);
} else {
html += '<a href="' + LibraryBrowser.getHref(item) + '">' + LibraryBrowser.getPosterViewDisplayName(item, false, false) + '</a>';
}
break;
}
case 'Name':
{
html += '<a href="' + LibraryBrowser.getHref(item) + '">' + LibraryBrowser.getPosterViewDisplayName(item, false, false) + '</a>';
break;
}
case 'Rating':
{
html += item.OfficialRating || '&nbsp;';
break;
}
case 'Year':
case 'Release Date':
{
if (item.PremiereDate && item.Type != "Series") {
try {
var date = parseISO8601Date(item.PremiereDate, { toLocal: true });
html += date.toLocaleDateString();
}
catch (e) {
html += '&nbsp;';
}
}
else if (item.ProductionYear) {
html += item.ProductionYear;
if (item.Status == "Continuing") {
html += "-Present";
}
else if (item.EndDate) {
try {
var endYear = parseISO8601Date(item.EndDate, { toLocal: true }).getFullYear();
if (endYear != item.ProductionYear) {
html += "-" + parseISO8601Date(item.EndDate, { toLocal: true }).getFullYear();
}
}
catch (e) {
console.log("Error parsing date: " + item.EndDate);
}
}
} else {
html += '&nbsp;';
}
break;
}
case 'Date Added':
{
if (item.DateCreated) {
try {
html += parseISO8601Date(item.DateCreated, { toLocal: true }).toLocaleDateString();
}
catch (e) {
html += '&nbsp;';
}
}
break;
}
default:
{
if (item.LockData) {
html += '<img src="css/images/editor/lock.png" />';
}
if (item.IsUnidentified) {
html += '<div class="libraryReportIndicator"><div class="ui-icon-alert ui-btn-icon-notext"></div></div>';
}
if (!item.LocalTrailerCount && item.Type == "Movie") {
html += '<img src="css/images/editor/missingtrailer.png" title="Missing local trailer." />';
}
if (!item.ImageTags || !item.ImageTags.Primary) {
html += '<img src="css/images/editor/missingprimaryimage.png" title="Missing primary image." />';
}
if (!item.BackdropImageTags || !item.BackdropImageTags.length) {
if (item.Type !== "Episode" && item.Type !== "Season" && item.MediaType !== "Audio" && item.Type !== "Channel") {
html += '<img src="css/images/editor/missingbackdrop.png" title="Missing backdrop image." />';
}
}
if (!item.ImageTags || !item.ImageTags.Logo) {
if (item.Type == "Movie" || item.Type == "Trailer" || item.Type == "Series" || item.Type == "MusicArtist" || item.Type == "BoxSet") {
html += '<img src="css/images/editor/missinglogo.png" title="Missing logo image." />';
}
}
break;
}
}
html += '</td>';
return html;
}).join('');
}
function getReportHtml(items, reportType) {
var html = '';
html += '<table data-role="table" data-mode="reflow" class="tblLibraryReport detailTable stripedTable ui-responsive table-stroke" style="display: table;">';
html += '<thead>';
html += '<tr>';
var cells = getHeaderCells(reportType);
html += cells.map(function (c) {
return '<th>' + (c.name || '&nbsp;') + '</th>';
}).join('');
html += '</tr>';
html += '</thead>';
html += '<tbody>';
for (var i = 0, length = items.length; i < length; i++) {
var item = items[i];
html += '<tr>';
html += '<td>';
if (item.LockData) {
html += '<img src="css/images/editor/lock.png" />';
}
if (item.IsUnidentified) {
html += '<div class="libraryReportIndicator"><div class="ui-icon-alert ui-btn-icon-notext"></div></div>';
}
html += '</td>';
if (includeParentInfo) {
html += '<td>';
if (item.SeriesName) {
html += '<a href="itemdetails.html?id=' + item.SeriesId + '">' + item.SeriesName + '</a>';
}
else if (item.Album) {
html += item.Album;
}
else if (item.AlbumArtist) {
html += item.AlbumArtist;
}
else if (item.GameSystem) {
html += item.GameSystem;
}
else {
html += '&nbsp;';
}
html += '</td>';
}
html += '<td>';
html += '<a href="' + LibraryBrowser.getHref(item) + '">' + LibraryBrowser.getPosterViewDisplayName(item, false, true) + '</a>';
html += '</td>';
html += '<td>';
if (item.DateCreated) {
try {
html += parseISO8601Date(item.DateCreated, { toLocal: true }).toLocaleDateString();
}
catch (e) {
html += '&nbsp;';
}
}
html += '</td>';
html += '<td>';
if (item.PremiereDate && item.Type != "Series") {
try {
var date = parseISO8601Date(item.PremiereDate, { toLocal: true });
html += date.toLocaleDateString();
}
catch (e) {
html += '&nbsp;';
}
}
else if (item.ProductionYear) {
html += item.ProductionYear;
if (item.Status == "Continuing") {
html += "-Present";
}
else if (item.EndDate) {
try {
var endYear = parseISO8601Date(item.EndDate, { toLocal: true }).getFullYear();
if (endYear != item.ProductionYear) {
html += "-" + parseISO8601Date(item.EndDate, { toLocal: true }).getFullYear();
}
}
catch (e) {
console.log("Error parsing date: " + item.EndDate);
}
}
} else {
html += '&nbsp;';
}
html += '</td>';
html += '<td>';
html += item.OfficialRating || '&nbsp;';
html += '</td>';
html += '<td>';
if (item.RunTimeTicks) {
html += Dashboard.getDisplayTime(item.RunTimeTicks);
} else {
html += '&nbsp;';
}
html += '</td>';
if (includePlayers) {
html += '<td>';
html += item.Players || '&nbsp;';
html += '</td>';
}
html += '<td>';
html += (item.MediaStreams || []).filter(function (s) {
return s.Type != 'Subtitle';
}).map(getCodecName).filter(function (s) {
return s;
}).join('<br/>');
html += '</td>';
if (includeSubtitles) {
html += '<td>';
html += (item.MediaStreams || []).filter(function (s) {
return s.Type == 'Subtitle';
}).map(function (s) {
return (s.Language || 'und') + ' - ' + s.Codec;
}).join('<br/>');
html += '</td>';
}
html += '<td>';
if (item.SpecialFeatureCount == 1) {
html += '1 Special<br/>';
}
else if (item.SpecialFeatureCount) {
html += item.SpecialFeatureCount + ' Specials<br/>';
}
if (item.LocalTrailerCount == 1) {
html += '1 Trailer<br/>';
}
else if (item.LocalTrailerCount) {
html += item.LocalTrailerCount + ' Trailers<br/>';
}
html += '</td>';
html += getItemCellsHtml(item, cells);
html += '</tr>';
}
html += '</tbody>';
html += '</table>';
return html;
}
function renderItems(page, result) {
function renderItems(page, result, reportType) {
// Scroll back up so they can see the results from the beginning
$(document).scrollTop(0);
@ -197,46 +427,7 @@
$('.listBottomPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount)).trigger('create');
var includeParentInfo = query.IncludeItemTypes == "Audio" || query.IncludeItemTypes == "MusicAlbum" || query.IncludeItemTypes == "Episode" || query.IncludeItemTypes == "Book" || query.IncludeItemTypes == "Game";
var includeSubtitles = query.IncludeItemTypes == "Movie" || query.IncludeItemTypes == "Trailer" || query.IncludeItemTypes == "Episode" || query.IncludeItemTypes == "AdultVideo" || query.IncludeItemTypes == "MusicVideo" || query.IncludeItemTypes == "Video";
var includePlayers = query.IncludeItemTypes == "Game";
if (includeParentInfo) {
var parentLabel = "Series";
if (query.IncludeItemTypes == "Audio") {
parentLabel = "Album";
}
else if (query.IncludeItemTypes == "MusicAlbum") {
parentLabel = "Artist";
}
else if (query.IncludeItemTypes == "Game") {
parentLabel = "Game System";
}
$('.thParent', page).html(parentLabel).show();
} else {
$('.thParent', page).hide();
}
if (includeSubtitles) {
$('.thSubtitles', page).show();
} else {
$('.thSubtitles', page).hide();
}
if (includePlayers) {
$('.thPlayers', page).show();
} else {
$('.thPlayers', page).hide();
}
var rowsHtml = getTableRowsHtml(result.Items, includeParentInfo, includeSubtitles, includePlayers);
$('.resultBody', page).html(rowsHtml).parents('.tblLibraryReport').table("refresh").trigger('create');
$('.reportContainer', page).html(getReportHtml(result.Items, reportType)).trigger('create');
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
@ -258,10 +449,11 @@
function reloadItems(page) {
var url = ApiClient.getUrl("Items", query);
var reportType = $('#selectView', page).val();
$.getJSON(url).done(function (result) {
renderItems(page, result);
renderItems(page, result, reportType);
});
}
@ -288,12 +480,18 @@
$('#chkSpecialFeature', page).checked(query.HasSpecialFeature == true).checkboxradio('refresh');
$('#chkThemeSong', page).checked(query.HasThemeSong == true).checkboxradio('refresh');
$('#chkThemeVideo', page).checked(query.HasThemeVideo == true).checkboxradio('refresh');
$('#chkIsPlaceHolder', page).checked(query.IsPlaceHolder == true).checkboxradio('refresh');
$('#chkMissingRating', page).checked(query.HasOfficialRating == false).checkboxradio('refresh');
$('#chkMissingOverview', page).checked(query.HasOverview == false).checkboxradio('refresh');
$('#chkYearMismatch', page).checked(query.IsYearMismatched == true).checkboxradio('refresh');
$('#chkIsUnidentified', page).checked(query.IsUnidentified == true).checkboxradio('refresh');
$('#chkIsLocked', page).checked(query.IsLocked == true).checkboxradio('refresh');
$('#chkSpecialEpisode', page).checked(query.ParentIndexNumber == 0).checkboxradio('refresh');
$('#chkMissingEpisode', page).checked(query.IsMissing == true).checkboxradio('refresh');
$('#chkFutureEpisode', page).checked(query.IsUnaired == true).checkboxradio('refresh');
}
$(document).on('pageinit', "#libraryReportPage", function () {
@ -406,6 +604,14 @@
reloadItems(page);
});
$('#chkIsPlaceHolder', page).on('change', function () {
query.StartIndex = 0;
query.IsPlaceHolder = this.checked ? true : null;
reloadItems(page);
});
$('#chkThemeSong', page).on('change', function () {
query.StartIndex = 0;
@ -430,6 +636,14 @@
reloadItems(page);
});
$('#chkMissingRating', page).on('change', function () {
query.StartIndex = 0;
query.HasOfficialRating = this.checked ? false : null;
reloadItems(page);
});
$('#chkYearMismatch', page).on('change', function () {
query.StartIndex = 0;
@ -454,6 +668,37 @@
reloadItems(page);
});
$('#chkMissingEpisode', page).on('change', function () {
query.StartIndex = 0;
query.IsMissing = this.checked ? true : false;
reloadItems(page);
});
$('#chkFutureEpisode', page).on('change', function () {
query.StartIndex = 0;
if (this.checked) {
query.IsUnaired = true;
query.IsVirtualUnaired = null;
} else {
query.IsUnaired = null;
query.IsVirtualUnaired = false;
}
reloadItems(page);
});
$('#chkSpecialEpisode', page).on('change', function () {
query.ParentIndexNumber = this.checked ? 0 : null;
reloadItems(page);
});
}).on('pagebeforeshow', "#libraryReportPage", function () {
var page = this;

View File

@ -713,7 +713,7 @@ var Dashboard = {
href: "dashboard.html",
selected: page.hasClass("dashboardHomePage")
}, {
name: "Media Library",
name: "Library",
divider: true,
href: "library.html",
selected: page.hasClass("mediaLibraryPage")
@ -1347,9 +1347,6 @@ $(function () {
footerHtml += '<button onclick="MediaPlayer.toggleFullscreen();" id="fullscreenButton" class="mediaButton fullscreenButton" title="Fullscreen" type="button" data-icon="action" data-iconpos="notext" data-inline="true">Fullscreen</button>';
footerHtml += '<button onclick="MediaPlayer.showChannelsFlyout();" id="channelsButton" class="mediaButton channelsButton" title="TV Channels" type="button" data-icon="tv" data-iconpos="notext" data-inline="true">TV Channels</button>';
footerHtml += '<div class="mediaFlyoutContainer"><div id="channelsFlyout" style="display:none;" class="mediaPlayerFlyout channelsFlyout"></div></div>';
footerHtml += '<button onclick="MediaPlayer.showSendMediaMenu();" id="sendMediaButton" class="mediaButton sendMediaButton" title="Remote" type="button" data-icon="wireless" data-iconpos="notext" data-inline="true">Remote</button>';
footerHtml += '</div>';