mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
added refresh metadata button to the edit page
This commit is contained in:
parent
14bbc7b9c5
commit
057f6bfabf
7 changed files with 163 additions and 89 deletions
22
ApiClient.js
22
ApiClient.js
|
@ -377,6 +377,28 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Refreshes metadata for an item
|
||||||
|
*/
|
||||||
|
self.refreshItem = function (itemId, force, recursive) {
|
||||||
|
|
||||||
|
if (!itemId) {
|
||||||
|
throw new Error("null itemId");
|
||||||
|
}
|
||||||
|
|
||||||
|
var url = self.getUrl("Items/" + itemId + "/Refresh", {
|
||||||
|
|
||||||
|
force: force || false,
|
||||||
|
recursive: recursive || false
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
return self.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: url
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Installs or updates a new plugin
|
* Installs or updates a new plugin
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -408,11 +408,19 @@ a.itemTag:hover {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.editMetadataForm {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
@media all and (min-width: 600px) {
|
@media all and (min-width: 600px) {
|
||||||
.inlineDetailSection:not(.hide) {
|
.inlineDetailSection:not(.hide) {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-bottom: 2em;
|
margin-bottom: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.editMetadataForm .ui-field-contain {
|
||||||
|
margin: .25em 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (max-width: 750px) {
|
@media all and (max-width: 750px) {
|
||||||
|
@ -475,6 +483,16 @@ a.itemTag:hover {
|
||||||
.noBackdrop .lnkSibling {
|
.noBackdrop .lnkSibling {
|
||||||
bottom: 205px;
|
bottom: 205px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.metadataFormFields {
|
||||||
|
float: left;
|
||||||
|
width: 70%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.metadataFormButtons {
|
||||||
|
float: right;
|
||||||
|
width: 28%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (min-width: 650px) {
|
@media all and (min-width: 650px) {
|
||||||
|
|
|
@ -153,10 +153,10 @@
|
||||||
opacity: .9;
|
opacity: .9;
|
||||||
border-right: 5px solid rgba(0,0,0,0);
|
border-right: 5px solid rgba(0,0,0,0);
|
||||||
border-left: 5px solid rgba(0,0,0,0);
|
border-left: 5px solid rgba(0,0,0,0);
|
||||||
border-radius: 50px;
|
border-radius: 30px;
|
||||||
box-shadow: 0 0 35px #2187e7;
|
box-shadow: 0 0 20px #2187e7;
|
||||||
width: 50px;
|
width: 30px;
|
||||||
height: 50px;
|
height: 30px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
-moz-animation: spinPulse 1s infinite ease-in-out;
|
-moz-animation: spinPulse 1s infinite ease-in-out;
|
||||||
-webkit-animation: spinPulse 1s infinite linear;
|
-webkit-animation: spinPulse 1s infinite linear;
|
||||||
|
@ -168,13 +168,13 @@
|
||||||
opacity: .9;
|
opacity: .9;
|
||||||
border-left: 5px solid rgba(0,0,0,0);
|
border-left: 5px solid rgba(0,0,0,0);
|
||||||
border-right: 5px solid rgba(0,0,0,0);
|
border-right: 5px solid rgba(0,0,0,0);
|
||||||
border-radius: 50px;
|
border-radius: 30px;
|
||||||
box-shadow: 0 0 15px #2187e7;
|
box-shadow: 0 0 15px #2187e7;
|
||||||
width: 30px;
|
width: 15px;
|
||||||
height: 30px;
|
height: 15px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
position: relative;
|
position: relative;
|
||||||
top: -50px;
|
top: -32px;
|
||||||
-moz-animation: spinoffPulse 1s infinite linear;
|
-moz-animation: spinoffPulse 1s infinite linear;
|
||||||
-webkit-animation: spinoffPulse 1s infinite linear;
|
-webkit-animation: spinoffPulse 1s infinite linear;
|
||||||
}
|
}
|
||||||
|
|
|
@ -188,7 +188,6 @@ h1 .imageLink {
|
||||||
border: 0;
|
border: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
cursor: hand;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.imageButton:hover {
|
.imageButton:hover {
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
<div class="ui-bar-c parentName" style="display: none;">
|
<div class="ui-bar-c parentName" style="display: none;">
|
||||||
</div>
|
</div>
|
||||||
<div data-role="content">
|
<div data-role="content">
|
||||||
|
|
||||||
<div class="ehsContent">
|
<div class="ehsContent">
|
||||||
<h1 class="itemName detailPageName"></h1>
|
<h1 class="itemName detailPageName"></h1>
|
||||||
<br />
|
<br />
|
||||||
|
@ -17,86 +16,105 @@
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('edititemimages.html', true);">Images</a>
|
<a href="#" data-role="button" onclick="Dashboard.navigate('edititemimages.html', true);">Images</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form id="editItemMetadataForm" style="max-width: 100%;">
|
<form id="editItemMetadataForm" class="editMetadataForm">
|
||||||
<div data-role="fieldcontain">
|
<div class="metadataFormFields">
|
||||||
<label for="txtName">Name:</label>
|
<div data-role="fieldcontain">
|
||||||
<input type="text" id="txtName" name="txtName" required="required" data-mini="true" />
|
<label for="txtName">Name:</label>
|
||||||
|
<input type="text" id="txtName" name="txtName" required="required" data-mini="true" />
|
||||||
|
</div>
|
||||||
|
<div data-role="fieldcontain">
|
||||||
|
<label for="txtSortName">Sort name:</label>
|
||||||
|
<input type="text" id="txtSortName" name="txtSortName" data-mini="true" />
|
||||||
|
</div>
|
||||||
|
<div data-role="fieldcontain">
|
||||||
|
<label for="txtDisplayMediaType">Display type:</label>
|
||||||
|
<input type="text" id="txtDisplayMediaType" name="txtDisplayMediaType" data-mini="true" />
|
||||||
|
</div>
|
||||||
|
<div data-role="fieldcontain" id="fldParentIndexNumber" style="display: none;">
|
||||||
|
<label id="lblParentIndexNumber" for="txtParentIndexNumber">Parent number:</label>
|
||||||
|
<input type="number" id="txtParentIndexNumber" name="txtParentIndexNumber" data-mini="true" pattern="[0-9]*" />
|
||||||
|
</div>
|
||||||
|
<div data-role="fieldcontain" id="fldIndexNumber" style="display: none;">
|
||||||
|
<label id="lblIndexNumber" for="txtIndexNumber">Number:</label>
|
||||||
|
<input type="number" id="txtIndexNumber" name="txtIndexNumber" data-mini="true" pattern="[0-9]*" />
|
||||||
|
</div>
|
||||||
|
<div data-role="fieldcontain">
|
||||||
|
<label for="txtCommunityRating">Community rating:</label>
|
||||||
|
<input type="number" id="txtCommunityRating" name="txtCommunityRating" step=".1" data-mini="true" />
|
||||||
|
</div>
|
||||||
|
<div data-role="fieldcontain">
|
||||||
|
<label for="txtCriticRating">Critic rating:</label>
|
||||||
|
<input type="number" id="txtCriticRating" name="txtCriticRating" step=".1" data-mini="true" />
|
||||||
|
</div>
|
||||||
|
<div data-role="fieldcontain">
|
||||||
|
<label for="txtCriticRatingSummary">Critic rating summary:</label>
|
||||||
|
<input type="text" id="txtCriticRatingSummary" name="txtCriticRatingSummary" data-mini="true" />
|
||||||
|
</div>
|
||||||
|
<div data-role="fieldcontain">
|
||||||
|
<label for="txtHomePageUrl">Website:</label>
|
||||||
|
<input type="url" id="txtHomePageUrl" name="txtHomePageUrl" data-mini="true" />
|
||||||
|
</div>
|
||||||
|
<div data-role="fieldcontain">
|
||||||
|
<label for="txtPremiereDate">Release date:</label>
|
||||||
|
<input type="date" id="txtPremiereDate" name="txtPremiereDate" data-mini="true" />
|
||||||
|
</div>
|
||||||
|
<div data-role="fieldcontain" id="fldEndDate" style="display: none;">
|
||||||
|
<label for="txtEndDate">End date:</label>
|
||||||
|
<input type="date" id="txtEndDate" name="txtEndDate" data-mini="true" />
|
||||||
|
</div>
|
||||||
|
<div data-role="fieldcontain">
|
||||||
|
<label for="txtProductionYear">Year:</label>
|
||||||
|
<input type="number" id="txtProductionYear" name="txtProductionYear" data-mini="true" />
|
||||||
|
</div>
|
||||||
|
<div data-role="fieldcontain">
|
||||||
|
<label for="selectOfficialRating">Official rating:</label>
|
||||||
|
<select name="selectOfficialRating" id="selectOfficialRating" data-mini="true"></select>
|
||||||
|
</div>
|
||||||
|
<div data-role="fieldcontain">
|
||||||
|
<label for="selectCustomRating">Custom rating:</label>
|
||||||
|
<select name="selectCustomRating" id="selectCustomRating" data-mini="true"></select>
|
||||||
|
</div>
|
||||||
|
<div data-role="fieldcontain" id="fldBudget" style="display: none;">
|
||||||
|
<label for="txtBudget">Budget ($):</label>
|
||||||
|
<input type="number" id="txtBudget" name="txtBudget" data-mini="true" />
|
||||||
|
</div>
|
||||||
|
<div data-role="fieldcontain" id="fldRevenue" style="display: none;">
|
||||||
|
<label for="txtRevenue">Revenue ($):</label>
|
||||||
|
<input type="number" id="txtRevenue" name="txtRevenue" data-mini="true" />
|
||||||
|
</div>
|
||||||
|
<div data-role="fieldcontain" id="fldOriginalAspectRatio" style="display: none;">
|
||||||
|
<label for="txtOriginalAspectRatio">Original aspect ratio:</label>
|
||||||
|
<input type="text" id="txtOriginalAspectRatio" name="txtOriginalAspectRatio" data-mini="true" />
|
||||||
|
</div>
|
||||||
|
<div data-role="fieldcontain" style="display: none;">
|
||||||
|
<label for="selectLanguage">Original language:</label>
|
||||||
|
<select name="selectLanguage" id="selectLanguage" data-mini="true"></select>
|
||||||
|
</div>
|
||||||
|
<ul data-role="listview" class="ulForm">
|
||||||
|
<li>
|
||||||
|
<button type="submit" data-theme="b" data-icon="ok">
|
||||||
|
Save
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div data-role="fieldcontain">
|
<div class="metadataFormButtons">
|
||||||
<label for="txtSortName">Sort name:</label>
|
|
||||||
<input type="text" id="txtSortName" name="txtSortName" data-mini="true" />
|
<div data-role="collapsible" data-content-theme="a" data-collapsed="false" data-mini="true">
|
||||||
|
<h3>Refresh Metadata</h3>
|
||||||
|
<div>
|
||||||
|
<div id="refreshLoading" style="display: none;">
|
||||||
|
<div class="circle"></div>
|
||||||
|
<div class="circle1"></div>
|
||||||
|
<div style="margin-top: -15px;"></div>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
<button id="btnRefresh" type="button" data-icon="refresh" data-mini="true" data-theme="b">Refresh</button>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div data-role="fieldcontain">
|
|
||||||
<label for="txtDisplayMediaType">Display media type:</label>
|
|
||||||
<input type="text" id="txtDisplayMediaType" name="txtDisplayMediaType" data-mini="true" />
|
|
||||||
</div>
|
|
||||||
<div data-role="fieldcontain" id="fldParentIndexNumber" style="display: none;">
|
|
||||||
<label id="lblParentIndexNumber" for="txtParentIndexNumber">Parent number:</label>
|
|
||||||
<input type="number" id="txtParentIndexNumber" name="txtParentIndexNumber" data-mini="true" pattern="[0-9]*" />
|
|
||||||
</div>
|
|
||||||
<div data-role="fieldcontain" id="fldIndexNumber" style="display: none;">
|
|
||||||
<label id="lblIndexNumber" for="txtIndexNumber">Number:</label>
|
|
||||||
<input type="number" id="txtIndexNumber" name="txtIndexNumber" data-mini="true" pattern="[0-9]*" />
|
|
||||||
</div>
|
|
||||||
<div data-role="fieldcontain">
|
|
||||||
<label for="txtCommunityRating">Community rating:</label>
|
|
||||||
<input type="number" id="txtCommunityRating" name="txtCommunityRating" step=".1" data-mini="true" />
|
|
||||||
</div>
|
|
||||||
<div data-role="fieldcontain">
|
|
||||||
<label for="txtCriticRating">Critic rating:</label>
|
|
||||||
<input type="number" id="txtCriticRating" name="txtCriticRating" step=".1" data-mini="true" />
|
|
||||||
</div>
|
|
||||||
<div data-role="fieldcontain">
|
|
||||||
<label for="txtCriticRatingSummary">Critic rating summary:</label>
|
|
||||||
<input type="text" id="txtCriticRatingSummary" name="txtCriticRatingSummary" data-mini="true" />
|
|
||||||
</div>
|
|
||||||
<div data-role="fieldcontain">
|
|
||||||
<label for="txtHomePageUrl">Website:</label>
|
|
||||||
<input type="url" id="txtHomePageUrl" name="txtHomePageUrl" data-mini="true" />
|
|
||||||
</div>
|
|
||||||
<div data-role="fieldcontain">
|
|
||||||
<label for="txtPremiereDate">Release date:</label>
|
|
||||||
<input type="date" id="txtPremiereDate" name="txtPremiereDate" data-mini="true" />
|
|
||||||
</div>
|
|
||||||
<div data-role="fieldcontain" id="fldEndDate" style="display: none;">
|
|
||||||
<label for="txtEndDate">End date:</label>
|
|
||||||
<input type="date" id="txtEndDate" name="txtEndDate" data-mini="true" />
|
|
||||||
</div>
|
|
||||||
<div data-role="fieldcontain">
|
|
||||||
<label for="txtProductionYear">Year:</label>
|
|
||||||
<input type="number" id="txtProductionYear" name="txtProductionYear" data-mini="true" />
|
|
||||||
</div>
|
|
||||||
<div data-role="fieldcontain">
|
|
||||||
<label for="selectOfficialRating">Official rating:</label>
|
|
||||||
<select name="selectOfficialRating" id="selectOfficialRating" data-mini="true"></select>
|
|
||||||
</div>
|
|
||||||
<div data-role="fieldcontain">
|
|
||||||
<label for="selectCustomRating">Custom rating:</label>
|
|
||||||
<select name="selectCustomRating" id="selectCustomRating" data-mini="true"></select>
|
|
||||||
</div>
|
|
||||||
<div data-role="fieldcontain" id="fldBudget" style="display: none;">
|
|
||||||
<label for="txtBudget">Budget:</label>
|
|
||||||
<input type="number" id="txtBudget" name="txtBudget" data-mini="true" />
|
|
||||||
</div>
|
|
||||||
<div data-role="fieldcontain" id="fldRevenue" style="display: none;">
|
|
||||||
<label for="txtRevenue">Revenue:</label>
|
|
||||||
<input type="number" id="txtRevenue" name="txtRevenue" data-mini="true" />
|
|
||||||
</div>
|
|
||||||
<div data-role="fieldcontain" id="fldOriginalAspectRatio" style="display: none;">
|
|
||||||
<label for="txtOriginalAspectRatio">Original aspect ratio:</label>
|
|
||||||
<input type="text" id="txtOriginalAspectRatio" name="txtOriginalAspectRatio" data-mini="true" />
|
|
||||||
</div>
|
|
||||||
<div data-role="fieldcontain">
|
|
||||||
<label for="selectLanguage">Original language:</label>
|
|
||||||
<select name="selectLanguage" id="selectLanguage" data-mini="true"></select>
|
|
||||||
</div>
|
|
||||||
<ul data-role="listview" class="ulForm">
|
|
||||||
<li>
|
|
||||||
<button type="submit" data-theme="b" data-icon="ok">
|
|
||||||
Save
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -10,6 +10,10 @@
|
||||||
|
|
||||||
ApiClient.getItem(Dashboard.getCurrentUserId(), id).done(function (item) {
|
ApiClient.getItem(Dashboard.getCurrentUserId(), id).done(function (item) {
|
||||||
|
|
||||||
|
$('#btnRefresh', page).button('enable');
|
||||||
|
|
||||||
|
$('#refreshLoading', page).hide();
|
||||||
|
|
||||||
currentItem = item;
|
currentItem = item;
|
||||||
|
|
||||||
LibraryBrowser.renderName(item, $('.itemName', page), true);
|
LibraryBrowser.renderName(item, $('.itemName', page), true);
|
||||||
|
@ -214,6 +218,19 @@
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
|
||||||
|
$('#btnRefresh', this).on('click', function () {
|
||||||
|
|
||||||
|
$(this).button('disable');
|
||||||
|
|
||||||
|
$('#refreshLoading', page).show();
|
||||||
|
|
||||||
|
ApiClient.refreshItem(currentItem.Id, true, false).done(function () {
|
||||||
|
|
||||||
|
reload(page);
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
}).on('pageshow', "#editItemMetadataPage", function () {
|
}).on('pageshow', "#editItemMetadataPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
|
@ -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.115" targetFramework="net45" />
|
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.117" targetFramework="net45" />
|
||||||
<package id="ServiceStack.Common" version="3.9.46" targetFramework="net45" />
|
<package id="ServiceStack.Common" version="3.9.46" targetFramework="net45" />
|
||||||
<package id="ServiceStack.Text" version="3.9.45" targetFramework="net45" />
|
<package id="ServiceStack.Text" version="3.9.45" targetFramework="net45" />
|
||||||
</packages>
|
</packages>
|
Loading…
Add table
Add a link
Reference in a new issue