Passed
Push — feature/909_Ampache_API_improv... ( b6c69f...943762 )
by Pauli
04:51 queued 02:07
created

AmpachePreferences::getAll()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
rs 10
c 1
b 0
f 0
1
<?php declare(strict_types=1);
2
3
/**
4
 * ownCloud - Music app
5
 *
6
 * This file is licensed under the Affero General Public License version 3 or
7
 * later. See the COPYING file.
8
 *
9
 * @author Pauli Järvinen <[email protected]>
10
 * @copyright Pauli Järvinen 2023
11
 */
12
13
namespace OCA\Music\Utility;
14
15
/**
16
 * Minimal mocked user preferences needed to support the Ample client
17
 */
18
class AmpachePreferences {
19
20
	private const SETTINGS = [
21
		[
22
			'id' => 122,
23
			'name' => 'album_release_type',
24
			'level' => 100,
25
			'description' => 'Album - Group per release type',
26
			'value' => '0',
27
			'type' => 'boolean',
28
			'category' => 'interface',
29
			'subcategory' => 'library'
30
		],
31
		[
32
			'id' => 130,
33
			'name' => 'album_release_type_sort',
34
			'level' => 100,
35
			'description' => 'Album - Group per release type sort',
36
			'value' => 'album,ep,live,single',
37
			'type' => 'string',
38
			'category' => 'interface',
39
			'subcategory' => 'library'
40
		]
41
	];
42
43
	public static function getAll() : array {
44
		return self::SETTINGS;
45
	}
46
47
	public static function get(string $name) : ?array {
48
        return \array_column(self::SETTINGS, null, 'name')[$name] ?? null;
49
	}
50
}