-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
SubsonicSettings.cs
66 lines (60 loc) · 1.82 KB
/
SubsonicSettings.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using System;
namespace MusicBeePlugin.Domain
{
public class SubsonicSettings
{
public enum AuthMethod
{
Token,
HexPass
}
public enum ConnectionProtocol
{
Http,
Https
}
public enum ServerType
{
Subsonic,
LibreSonic
}
public string Host { get; set; }
public string Port { get; set; }
public string BasePath { get; set; }
public string Username { get; set; }
public string Password { get; set; }
public bool Transcode { get; set; }
public ConnectionProtocol Protocol { get; set; }
public AuthMethod Auth { get; set; }
public string BitRate { get; set; }
public bool UseIndexCache { get; set; }
public bool PreCacheAll { get; set; }
}
public static class SubsonicSettingsExtensions
{
public static string ToFriendlyString(this SubsonicSettings.ConnectionProtocol me)
{
switch (me)
{
case SubsonicSettings.ConnectionProtocol.Http:
return "HTTP";
case SubsonicSettings.ConnectionProtocol.Https:
return "HTTPS";
default:
throw new ArgumentOutOfRangeException(nameof(me), me, null);
}
}
public static string ToFriendlyString(this SubsonicSettings.AuthMethod me)
{
switch (me)
{
case SubsonicSettings.AuthMethod.Token:
return "Token";
case SubsonicSettings.AuthMethod.HexPass:
return "HexPass";
default:
throw new ArgumentOutOfRangeException(nameof(me), me, null);
}
}
}
}