Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions src/components/directorybrowser/directorybrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,6 @@ function getEditorHtml(options, systemInfo) {
if (!readOnlyAttribute) {
html += '<div class="results paperList" style="max-height: 200px; overflow-y: auto;"></div>';
}
if (options.enableNetworkSharePath) {
html += '<div class="inputContainer" style="margin-top:2em;">';
html += `<input is="emby-input" id="txtNetworkPath" type="text" label="${globalize.translate('LabelOptionalNetworkPath')}"/>`;
html += '<div class="fieldDescription">';
html += globalize.translate('LabelOptionalNetworkPathHelp', '<b>\\\\server</b>', '<b>\\\\192.168.1.101</b>');
html += '</div>';
html += '</div>';
}
html += '<div class="formDialogFooter">';
html += `<button is="emby-button" type="submit" class="raised button-submit block formDialogFooterItem">${globalize.translate('ButtonOk')}</button>`;
html += '</div>';
Expand Down Expand Up @@ -209,12 +201,10 @@ function initEditor(content, options, fileOptions) {

content.querySelector('form').addEventListener('submit', function(e) {
if (options.callback) {
let networkSharePath = this.querySelector('#txtNetworkPath');
networkSharePath = networkSharePath ? networkSharePath.value : null;
const path = this.querySelector('#txtDirectoryPickerPath').value;
validatePath(path, options.validateWriteable, ApiClient).then(
options.callback(path, networkSharePath)
).catch(() => { /* no-op */ });
validatePath(path, options.validateWriteable, ApiClient)
.then(options.callback(path))
.catch(() => { /* no-op */ });
}
e.preventDefault();
e.stopPropagation();
Expand Down Expand Up @@ -282,10 +272,6 @@ class DirectoryBrowser {
});
this.currentDialog = dlg;
dlg.querySelector('#txtDirectoryPickerPath').value = fetchedInitialPath;
const txtNetworkPath = dlg.querySelector('#txtNetworkPath');
if (txtNetworkPath) {
txtNetworkPath.value = options.networkSharePath || '';
}
if (!options.pathReadOnly) {
refreshDirectoryBrowser(dlg, fetchedInitialPath, fileOptions, true);
}
Expand Down
10 changes: 3 additions & 7 deletions src/components/mediaLibraryCreator/mediaLibraryCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ function onAddButtonClick() {
import('../directorybrowser/directorybrowser').then(({ default: DirectoryBrowser }) => {
const picker = new DirectoryBrowser();
picker.show({
callback: function (path, networkSharePath) {
callback: function (path) {
if (path) {
addMediaLocation(page, path, networkSharePath);
addMediaLocation(page, path);
}

picker.close();
Expand Down Expand Up @@ -161,7 +161,7 @@ function renderPaths(page) {
}
}

function addMediaLocation(page, path, networkSharePath) {
function addMediaLocation(page, path) {
const pathLower = path.toLowerCase();
const pathFilter = pathInfos.filter(p => {
return p.Path.toLowerCase() == pathLower;
Expand All @@ -172,10 +172,6 @@ function addMediaLocation(page, path, networkSharePath) {
Path: path
};

if (networkSharePath) {
pathInfo.NetworkPath = networkSharePath;
}

pathInfos.push(pathInfo);
renderPaths(page);
}
Expand Down
20 changes: 9 additions & 11 deletions src/components/mediaLibraryEditor/mediaLibraryEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,21 @@ function onEditLibrary() {
return false;
}

function addMediaLocation(page, path, networkSharePath) {
function addMediaLocation(page, path) {
const virtualFolder = currentOptions.library;
const refreshAfterChange = currentOptions.refresh;
ApiClient.addMediaPath(virtualFolder.Name, path, networkSharePath, refreshAfterChange).then(() => {
ApiClient.addMediaPath(virtualFolder.Name, path, null, refreshAfterChange).then(() => {
hasChanges = true;
refreshLibraryFromServer(page);
}, () => {
toast(globalize.translate('ErrorAddingMediaPathToVirtualFolder'));
});
}

function updateMediaLocation(page, path, networkSharePath) {
function updateMediaLocation(page, path) {
const virtualFolder = currentOptions.library;
ApiClient.updateMediaPath(virtualFolder.Name, {
Path: path,
NetworkPath: networkSharePath
Path: path
}).then(() => {
hasChanges = true;
refreshLibraryFromServer(page);
Expand Down Expand Up @@ -115,7 +114,7 @@ function onListItemClick(e) {
return;
}

showDirectoryBrowser(dom.parentWithClass(listItem, 'dlg-libraryeditor'), originalPath, pathInfo.NetworkPath);
showDirectoryBrowser(dom.parentWithClass(listItem, 'dlg-libraryeditor'), originalPath);
}
}

Expand Down Expand Up @@ -174,19 +173,18 @@ function onAddButtonClick() {
showDirectoryBrowser(dom.parentWithClass(this, 'dlg-libraryeditor'));
}

function showDirectoryBrowser(context, originalPath, networkPath) {
function showDirectoryBrowser(context, originalPath) {
import('../directorybrowser/directorybrowser').then(({ default: DirectoryBrowser }) => {
const picker = new DirectoryBrowser();
picker.show({
pathReadOnly: originalPath != null,
path: originalPath,
networkSharePath: networkPath,
callback: function (path, networkSharePath) {
callback: function (path) {
if (path) {
if (originalPath) {
updateMediaLocation(context, originalPath, networkSharePath);
updateMediaLocation(context, originalPath);
} else {
addMediaLocation(context, path, networkSharePath);
addMediaLocation(context, path);
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/strings/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -841,8 +841,6 @@
"LabelNumberOfGuideDaysHelp": "Downloading more days worth of guide data provides the ability to schedule out further in advance and view more listings, but it will also take longer to download. Auto will pick based on the number of channels.",
"LabelOpenclDevice": "OpenCL Device",
"LabelOpenclDeviceHelp": "This is the OpenCL device that is used for tone mapping. The left side of the dot is the platform number, and the right side is the device number on the platform. The default value is 0.0. The FFmpeg application file containing the OpenCL hardware acceleration method is required.",
"LabelOptionalNetworkPath": "Shared network folder",
"LabelOptionalNetworkPathHelp": "If this folder is shared on your network, supplying the network share path can allow clients on other devices to access media files directly. For example, {0} or {1}.",
"LabelOriginalAspectRatio": "Original aspect ratio",
"LabelOriginalName": "Original name",
"LabelOriginalTitle": "Original title",
Expand Down
Loading