Backport pull request #4654 from jellyfin/release-10.8.z
Add confirmation for 3rd party repos Original-merge: 331fa87216904dcc853a1112ee6c774d89765ed2 Merged-by: Bill Thornton <thornbill@users.noreply.github.com> Backported-by: Bill Thornton <thornbill@users.noreply.github.com>
This commit is contained in:
parent
2ce9988498
commit
b372953671
4 changed files with 54 additions and 12 deletions
|
@ -64,6 +64,16 @@ function renderPackage(pkg, installedPlugins, page) {
|
|||
|
||||
$('#description', page).text(pkg.description);
|
||||
$('#developer', page).text(pkg.owner);
|
||||
// This is a hack; the repository name and URL should be part of the global values
|
||||
// for the plugin, not each individual version. So we just use the top (latest)
|
||||
// version to get this information. If it's missing (no versions), then say so.
|
||||
if (pkg.versions.length) {
|
||||
$('#repositoryName', page).text(pkg.versions[0].repositoryName);
|
||||
$('#repositoryUrl', page).text(pkg.versions[0].repositoryUrl);
|
||||
} else {
|
||||
$('#repositoryName', page).text(globalize.translate('Unknown'));
|
||||
$('#repositoryUrl', page).text(globalize.translate('Unknown'));
|
||||
}
|
||||
|
||||
if (installedPlugin) {
|
||||
const currentVersionText = globalize.translate('MessageYouHaveVersionInstalled', '<strong>' + installedPlugin.Version + '</strong>');
|
||||
|
@ -80,7 +90,7 @@ function alertText(options) {
|
|||
}
|
||||
|
||||
function performInstallation(page, name, guid, version) {
|
||||
const developer = $('#developer', page).html().toLowerCase();
|
||||
const repositoryUrl = $('#repositoryUrl', page).html().toLowerCase();
|
||||
|
||||
const alertCallback = function () {
|
||||
loading.show();
|
||||
|
@ -93,7 +103,9 @@ function performInstallation(page, name, guid, version) {
|
|||
});
|
||||
};
|
||||
|
||||
if (developer !== 'jellyfin') {
|
||||
// Check the repository URL for the official Jellyfin repository domain, or
|
||||
// present the warning for 3rd party plugins.
|
||||
if (!repositoryUrl.startsWith('https://repo.jellyfin.org/')) {
|
||||
loading.hide();
|
||||
let msg = globalize.translate('MessagePluginInstallDisclaimer');
|
||||
msg += '<br/>';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue