Completed
Pull Request — master (#328)
by
unknown
02:17
created

OCA.Files.Files.getDownloadUrl   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
c 1
b 0
f 0
nc 4
nop 2
dl 0
loc 13
rs 9.4285
1
/**
2
 * Nextcloud - Gallery
3
 *
4
 *
5
 * This file is licensed under the Affero General Public License version 3 or
6
 * later. See the COPYING file.
7
 *
8
 * @author Cédric de Saint Martin <[email protected]>
9
 *
10
 * @copyright Olivier Paroz 2017
11
 */
12
/* global OCA, Gallery */
13
(function ($, OC, t) {
0 ignored issues
show
Unused Code introduced by
The parameter t is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Unused Code introduced by
t does not seem to be used.
Loading history...
14
	"use strict";
15
	OCA.Files.Files.getDownloadUrl = function (filename, dir) {
16
		var path = dir || this.getCurrentDirectory();
17
		if (_.isArray(filename)) {
18
			filename = JSON.stringify(filename);
19
		}
20
		var params = {
21
			path: path
22
		};
23
		if (filename) {
24
			params.files = filename;
25
		}
26
		return OC.generateUrl('/s/' + Gallery.token + '/download') + '?' + OC.buildQueryString(params);
27
	};
28
})(jQuery, OC, t);
29