mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-15 17:43:49 -07:00
File Browser
New: File Browser to navigate to folders when choosing paths
This commit is contained in:
parent
a55a77cb5b
commit
85a9b74008
51 changed files with 955 additions and 228 deletions
39
src/UI/Shared/FileBrowser/FileBrowserCollection.js
Normal file
39
src/UI/Shared/FileBrowser/FileBrowserCollection.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
'use strict';
|
||||
define(
|
||||
[
|
||||
'jquery',
|
||||
'backbone',
|
||||
'Shared/FileBrowser/FileBrowserModel'
|
||||
], function ($, Backbone, FileBrowserModel) {
|
||||
|
||||
return Backbone.Collection.extend({
|
||||
model: FileBrowserModel,
|
||||
url : window.NzbDrone.ApiRoot + '/filesystem',
|
||||
|
||||
parse: function(response) {
|
||||
var contents = [];
|
||||
|
||||
if (response.parent || response.parent === '') {
|
||||
|
||||
var type = 'parent';
|
||||
var name = '...';
|
||||
|
||||
if (response.parent === '') {
|
||||
type = 'computer';
|
||||
name = 'My Computer';
|
||||
}
|
||||
|
||||
contents.push({
|
||||
type : type,
|
||||
name : name,
|
||||
path : response.parent
|
||||
});
|
||||
}
|
||||
|
||||
$.merge(contents, response.directories);
|
||||
$.merge(contents, response.files);
|
||||
|
||||
return contents;
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue