mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update smart match tab
This commit is contained in:
parent
e7448d6369
commit
f45621207c
3 changed files with 27 additions and 29 deletions
|
@ -4,7 +4,7 @@
|
||||||
<title>${TitleAutoOrganize}</title>
|
<title>${TitleAutoOrganize}</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="libraryFileOrganizerSmartMatchPage" data-role="page" class="page type-interior organizePage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Auto-Organize" data-require="scripts/autoorganizesmart,jqmlistview">
|
<div id="libraryFileOrganizerSmartMatchPage" data-role="page" class="page type-interior organizePage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Auto-Organize" data-require="scripts/autoorganizesmart,paper-icon-item,paper-fab,paper-item-body">
|
||||||
|
|
||||||
<div data-role="content">
|
<div data-role="content">
|
||||||
<div class="content-primary">
|
<div class="content-primary">
|
||||||
|
|
|
@ -3430,7 +3430,7 @@
|
||||||
|
|
||||||
self.deleteSmartMatchEntries = function (entries) {
|
self.deleteSmartMatchEntries = function (entries) {
|
||||||
|
|
||||||
var url = self.getUrl("Library/FileOrganizations/SmartMatches");
|
var url = self.getUrl("Library/FileOrganizations/SmartMatches/Delete");
|
||||||
|
|
||||||
var postData = {
|
var postData = {
|
||||||
Entries: entries
|
Entries: entries
|
||||||
|
|
|
@ -49,42 +49,37 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
var html = "";
|
var html = "";
|
||||||
var currentType;
|
|
||||||
|
if (infos.length) {
|
||||||
|
html += '<div class="paperList">';
|
||||||
|
}
|
||||||
|
|
||||||
for (var i = 0, length = infos.length; i < length; i++) {
|
for (var i = 0, length = infos.length; i < length; i++) {
|
||||||
|
|
||||||
var info = infos[i];
|
var info = infos[i];
|
||||||
|
|
||||||
if (info.OrganizerType != currentType) {
|
html += '<paper-icon-item>';
|
||||||
currentType = info.OrganizerType;
|
|
||||||
|
|
||||||
if (html.length > 0) {
|
html += '<paper-fab mini icon="folder" item-icon class="blue"></paper-fab>';
|
||||||
html += "</ul>";
|
|
||||||
}
|
|
||||||
|
|
||||||
html += "<h2>" + currentType + "</h2>";
|
html += '<paper-item-body two-line>';
|
||||||
|
|
||||||
html += '<ul data-role="listview" data-inset="true" data-auto-enhanced="false" data-split-icon="action">';
|
html += "<div>" + info.DisplayName + "</div>";
|
||||||
}
|
|
||||||
|
|
||||||
html += "<li data-role='list-divider'><h3 style='font-weight:bold'>" + info.Name + "</h3></li>";
|
html += info.MatchStrings.map(function (m) {
|
||||||
|
return "<div secondary>" + m + "</div>";
|
||||||
|
}).join('');
|
||||||
|
|
||||||
for (var n = 0; n < info.MatchStrings.length; n++) {
|
html += '</paper-item-body>';
|
||||||
html += "<li title='" + info.MatchStrings[n] + "'>";
|
|
||||||
|
|
||||||
html += "<a style='padding-top: 0.5em; padding-bottom: 0.5em'>";
|
html += '<paper-icon-button icon="delete" class="btnDeleteMatchEntry" data-index="' + i + '" title="' + Globalize.translate('ButtonDelete') + '"></paper-icon-button>';
|
||||||
|
|
||||||
html += "<p>" + info.MatchStrings[n] + "</p>";
|
html += '</paper-icon-item>';
|
||||||
|
|
||||||
html += "<a id='btnDeleteMatchEntry" + info.Id + "' class='btnDeleteMatchEntry' href='#' data-id='" + info.Id + "' data-matchstring='" + info.MatchStrings[n] + "' data-icon='delete'>" + Globalize.translate('ButtonDelete') + "</a>";
|
|
||||||
|
|
||||||
html += "</a>";
|
|
||||||
|
|
||||||
html += "</li>";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
html += "</ul>";
|
if (infos.length) {
|
||||||
|
html += "</div>";
|
||||||
|
}
|
||||||
|
|
||||||
$('.divMatchInfos', page).html(html).trigger('create');
|
$('.divMatchInfos', page).html(html).trigger('create');
|
||||||
}
|
}
|
||||||
|
@ -105,12 +100,15 @@
|
||||||
$('.divMatchInfos', page).on('click', '.btnDeleteMatchEntry', function () {
|
$('.divMatchInfos', page).on('click', '.btnDeleteMatchEntry', function () {
|
||||||
|
|
||||||
var button = this;
|
var button = this;
|
||||||
|
var index = parseInt(button.getAttribute('data-index'));
|
||||||
|
|
||||||
var entries = [
|
var info = currentResult.Items[index];
|
||||||
{
|
var entries = info.MatchStrings.map(function (m) {
|
||||||
Name: button.getAttribute('data-id'),
|
return {
|
||||||
Value: button.getAttribute('data-matchstring')
|
Name: info.ItemName,
|
||||||
}];
|
Value: m
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
ApiClient.deleteSmartMatchEntries(entries).then(function () {
|
ApiClient.deleteSmartMatchEntries(entries).then(function () {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue