1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

fixes #914 - Add option to save metadata hidden

This commit is contained in:
Luke Pulverenti 2014-09-06 00:21:23 -04:00
parent 950fc7ee7a
commit 56d7a4b41f
8 changed files with 178 additions and 19 deletions

View file

@ -45,6 +45,8 @@
$('#chkEnableAlbumArtInDidl', page).checked(profile.EnableAlbumArtInDidl).checkboxradio('refresh');
renderXmlDocumentAttributes(page, profile.XmlRootAttributes || []);
var idInfo = profile.Identification || {};
renderIdentificationHeaders(page, idInfo.Headers || []);
@ -173,6 +175,73 @@
$('#identificationHeaderPopup', page).popup('close');
}
function renderXmlDocumentAttributes(page, attribute) {
var index = 0;
var html = '<ul data-role="listview" data-inset="true" data-split-icon="delete">' + attribute.map(function (h) {
var li = '<li>';
li += '<a href="#">';
li += '<div style="font-weight:normal;">' + h.Name + ' = ' + (h.Value || '') + '</div>';
li += '</a>';
li += '<a class="btnDeleteXmlAttribute" href="#" data-index="' + index + '"></a>';
li += '</li>';
index++;
return li;
}).join('') + '</ul>';
var elem = $('.xmlDocumentAttributeList', page).html(html).trigger('create');
$('.btnDeleteXmlAttribute', elem).on('click', function () {
var itemIndex = parseInt(this.getAttribute('data-index'));
currentProfile.XmlRootAttributes.splice(itemIndex, 1);
renderXmlDocumentAttributes(page, currentProfile.XmlRootAttributes);
});
}
function editXmlDocumentAttribute(page, attribute) {
isSubProfileNew = attribute == null;
attribute = attribute || {};
currentSubProfile = attribute;
var popup = $('#xmlAttributePopup', page);
$('#txtXmlAttributeName', popup).val(attribute.Name || '');
$('#txtXmlAttributeValue', popup).val(attribute.Value || '');
popup.popup('open');
}
function saveXmlDocumentAttribute(page) {
currentSubProfile.Name = $('#txtXmlAttributeName', page).val();
currentSubProfile.Value = $('#txtXmlAttributeValue', page).val();
if (isSubProfileNew) {
currentProfile.XmlRootAttributes.push(currentSubProfile);
}
renderXmlDocumentAttributes(page, currentProfile.XmlRootAttributes);
currentSubProfile = null;
$('#xmlAttributePopup', page).popup('close');
}
function renderSubProfiles(page, profile) {
renderDirectPlayProfiles(page, profile.DirectPlayProfiles);
@ -907,6 +976,11 @@
editIdentificationHeader(page);
});
$('.btnAddXmlDocumentAttribute', page).on('click', function () {
editXmlDocumentAttribute(page);
});
}).on('pageshow', "#dlnaProfilePage", function () {
var page = this;
@ -991,6 +1065,16 @@
saveIdentificationHeader(page);
return false;
},
onXmlAttributeFormSubmit: function () {
var form = this;
var page = $(form).parents('.page');
saveXmlDocumentAttribute(page);
return false;
}
};

View file

@ -148,49 +148,49 @@
if (item.MovieCount) {
html += '<input type="radio" name="ibnItems" id="radioMovies" class="context-movies" value="on" data-mini="true">';
html += '<input type="radio" name="ibnItems" id="radioMovies" class="context-movies" value="on">';
html += '<label for="radioMovies">'+Globalize.translate('TabMovies')+'</label>';
}
if (item.SeriesCount) {
html += '<input type="radio" name="ibnItems" id="radioShows" class="context-tv" value="on" data-mini="true">';
html += '<input type="radio" name="ibnItems" id="radioShows" class="context-tv" value="on">';
html += '<label for="radioShows">'+Globalize.translate('TabSeries')+'</label>';
}
if (item.EpisodeCount) {
html += '<input type="radio" name="ibnItems" id="radioEpisodes" class="context-tv" value="on" data-mini="true">';
html += '<input type="radio" name="ibnItems" id="radioEpisodes" class="context-tv" value="on">';
html += '<label for="radioEpisodes">'+Globalize.translate('TabEpisodes')+'</label>';
}
if (item.TrailerCount) {
html += '<input type="radio" name="ibnItems" id="radioTrailers" class="context-movies" value="on" data-mini="true">';
html += '<input type="radio" name="ibnItems" id="radioTrailers" class="context-movies" value="on">';
html += '<label for="radioTrailers">'+Globalize.translate('TabTrailers')+'</label>';
}
if (item.GameCount) {
html += '<input type="radio" name="ibnItems" id="radioGames" class="context-games" value="on" data-mini="true">';
html += '<input type="radio" name="ibnItems" id="radioGames" class="context-games" value="on">';
html += '<label for="radioGames">'+Globalize.translate('TabGames')+'</label>';
}
if (item.AlbumCount) {
html += '<input type="radio" name="ibnItems" id="radioAlbums" class="context-music" value="on" data-mini="true">';
html += '<input type="radio" name="ibnItems" id="radioAlbums" class="context-music" value="on">';
html += '<label for="radioAlbums">'+Globalize.translate('TabAlbums')+'</label>';
}
if (item.SongCount) {
html += '<input type="radio" name="ibnItems" id="radioSongs" class="context-music" value="on" data-mini="true">';
html += '<input type="radio" name="ibnItems" id="radioSongs" class="context-music" value="on">';
html += '<label for="radioSongs">'+Globalize.translate('TabSongs')+'</label>';
}
if (item.MusicVideoCount) {
html += '<input type="radio" name="ibnItems" id="radioMusicVideos" class="context-music" value="on" data-mini="true">';
html += '<input type="radio" name="ibnItems" id="radioMusicVideos" class="context-music" value="on">';
html += '<label for="radioMusicVideos">'+Globalize.translate('TabMusicVideos')+'</label>';
}

View file

@ -1275,23 +1275,23 @@
html += '</div>';
}
if (version.Size) {
if (version.Container) {
html += '<div><span class="mediaInfoLabel">Container</span><span class="mediaInfoAttribute">' + version.Container + '</span></div>';
}
var size = (version.Size / (1024 * 1024)).toFixed(0);
html += '<div><span class="mediaInfoLabel">Size</span><span class="mediaInfoAttribute">' + size + ' MB</span></div>';
if (version.Formats && version.Formats.length) {
//html += '<div><span class="mediaInfoLabel">Format</span><span class="mediaInfoAttribute">' + version.Formats.join(',') + '</span></div>';
}
if (version.Path) {
html += '<div style="max-width:600px;overflow:hidden;"><span class="mediaInfoLabel">Path</span><span class="mediaInfoAttribute">' + version.Path + '</span></div>';
}
if (version.Container) {
//html += '<div><span class="mediaInfoLabel">Container</span><span class="mediaInfoAttribute">' + version.Container + '</span></div>';
}
if (version.Size) {
if (version.Formats && version.Formats.length) {
//html += '<div><span class="mediaInfoLabel">Format</span><span class="mediaInfoAttribute">' + version.Formats.join(',') + '</span></div>';
var size = (version.Size / (1024 * 1024)).toFixed(0);
html += '<div><span class="mediaInfoLabel">Size</span><span class="mediaInfoAttribute">' + size + ' MB</span></div>';
}
return html;

View file

@ -112,9 +112,8 @@
if (MediaController.canPlay(item)) {
var resumePosition = (item.UserData || {}).PlaybackPositionTicks || 0;
var onPlayClick = 'LibraryBrowser.showPlayMenu(this, \'' + item.Id + '\', \'' + item.Type + '\', ' + item.IsFolder + ', \'' + item.MediaType + '\', ' + resumePosition + ');return false;';
html += '<button type="button" data-mini="true" data-inline="true" data-icon="play" data-iconpos="notext" title="' + Globalize.translate('ButtonPlay') + '" onclick="' + onPlayClick + '" style="' + buttonMargin + '">' + Globalize.translate('ButtonPlay') + '</button>';
html += '<button type="button" class="btnPlayItem" data-itemid="' + item.Id + '" data-itemtype="' + item.Type + '" data-isfolder="' + item.IsFolder + '" data-mediatype="' + item.MediaType + '" data-resumeposition="' + resumePosition + '" data-mini="true" data-inline="true" data-icon="play" data-iconpos="notext" title="' + Globalize.translate('ButtonPlay') + '" style="' + buttonMargin + '">' + Globalize.translate('ButtonPlay') + '</button>';
buttonCount++;
}
@ -152,6 +151,21 @@
return false;
}
function onPlayItemButtonClick() {
var id = this.getAttribute('data-itemid');
var type = this.getAttribute('data-itemtype');
var isFolder = this.getAttribute('data-isfolder') == 'true';
var mediaType = this.getAttribute('data-mediatype');
var resumePosition = parseInt(this.getAttribute('data-resumeposition'));
closeContextMenu();
LibraryBrowser.showPlayMenu(this, id, type, isFolder, mediaType, resumePosition);
return false;
}
function onMoreButtonClick() {
var card = $(this).parents('.card')[0];
@ -549,6 +563,7 @@
innerElem.html(getOverlayHtml(item, user, elem, commands)).trigger('create');
$('.btnPlayItem', innerElem).on('click', onPlayItemButtonClick);
$('.btnPlayTrailer', innerElem).on('click', onTrailerButtonClick);
$('.btnMoreCommands', innerElem).on('click', onMoreButtonClick);
});

View file

@ -2,6 +2,8 @@
function loadAdvancedConfig(page, config) {
$('#chkSaveMetadataHidden', page).checked(config.SaveMetadataHidden).checkboxradio("refresh");
$('#chkEnableTmdbPersonUpdates', page).checked(config.EnableTmdbUpdates).checkboxradio("refresh");
$('#chkEnableTvdbUpdates', page).checked(config.EnableTvDbUpdates).checkboxradio("refresh");
$('#chkEnableFanartUpdates', page).checked(config.EnableFanArtUpdates).checkboxradio("refresh");
@ -174,6 +176,8 @@
ApiClient.getServerConfiguration().done(function (config) {
config.SaveMetadataHidden = $('#chkSaveMetadataHidden', form).checked();
config.EnableTvDbUpdates = $('#chkEnableTvdbUpdates', form).checked();
config.EnableTmdbUpdates = $('#chkEnableTmdbPersonUpdates', form).checked();
config.EnableFanArtUpdates = $('#chkEnableFanartUpdates', form).checked();