Skip to content

Commit 99f7d85

Browse files
author
Meyn
committed
Disable Lastfm metadata
1 parent b619be0 commit 99f7d85

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

Tubifarry/Metadata/Proxy/MetadataProvider/Lastfm/LastfmMetadataProxySettings.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ public class LastfmMetadataProxySettingsValidator : AbstractValidator<LastfmMeta
1111
{
1212
public LastfmMetadataProxySettingsValidator()
1313
{
14+
15+
RuleFor(x => x)
16+
.Must(x => false)
17+
.WithMessage("This version of Tubifarry does not support Last.fm for metadata. You would need to switch to develop!");
18+
1419
RuleFor(x => x.ApiKey)
1520
.NotEmpty()
1621
.WithMessage("A Last.fm API key is required.");
@@ -48,32 +53,33 @@ public LastfmMetadataProxySettingsValidator()
4853
RuleFor(x => x.UseAtOwnRisk)
4954
.Equal(true)
5055
.WithMessage("You must acknowledge that this feature is in alpha state by checking the 'Warning' box.");
56+
5157
}
5258
}
5359

5460
public class LastfmMetadataProxySettings : IProviderConfig
5561
{
5662
private static readonly LastfmMetadataProxySettingsValidator Validator = new();
5763

58-
[FieldDefinition(1, Label = "API Key", Type = FieldType.Textbox, Privacy = PrivacyLevel.ApiKey, HelpText = "Your Last.fm API key", Placeholder = "Enter your API key")]
64+
[FieldDefinition(1, Label = "API Key", Type = FieldType.Textbox, Privacy = PrivacyLevel.ApiKey, HelpText = "Your Last.fm API key", Placeholder = "Enter your API key", Hidden = HiddenType.Hidden)]
5965
public string ApiKey { get; set; } = string.Empty;
6066

61-
[FieldDefinition(2, Label = "User Agent", Section = MetadataSectionType.Metadata, Type = FieldType.Textbox, HelpText = "Specify a custom User-Agent to identify yourself. A User-Agent helps servers understand the software making the request. Use a unique identifier that includes a name and version. Avoid generic or suspicious-looking User-Agents to prevent blocking.", Placeholder = "Lidarr/1.0.0")]
67+
[FieldDefinition(2, Label = "User Agent", Section = MetadataSectionType.Metadata, Type = FieldType.Textbox, HelpText = "Specify a custom User-Agent to identify yourself. A User-Agent helps servers understand the software making the request. Use a unique identifier that includes a name and version. Avoid generic or suspicious-looking User-Agents to prevent blocking.", Placeholder = "Lidarr/1.0.0", Hidden = HiddenType.Hidden)]
6268
public string UserAgent { get; set; } = string.Empty;
6369

64-
[FieldDefinition(3, Label = "Page Number", Type = FieldType.Number, HelpText = "Page number for pagination", Placeholder = "1")]
70+
[FieldDefinition(3, Label = "Page Number", Type = FieldType.Number, HelpText = "Page number for pagination", Placeholder = "1", Hidden = HiddenType.Hidden)]
6571
public int PageNumber { get; set; } = 1;
6672

67-
[FieldDefinition(4, Label = "Page Size", Type = FieldType.Number, HelpText = "Page size for pagination", Placeholder = "30")]
73+
[FieldDefinition(4, Label = "Page Size", Type = FieldType.Number, HelpText = "Page size for pagination", Placeholder = "30", Hidden = HiddenType.Hidden)]
6874
public int PageSize { get; set; } = 3;
6975

70-
[FieldDefinition(5, Label = "Cache Type", Type = FieldType.Select, SelectOptions = typeof(CacheType), HelpText = "Select Memory (non-permanent) or Permanent caching")]
76+
[FieldDefinition(5, Label = "Cache Type", Type = FieldType.Select, SelectOptions = typeof(CacheType), HelpText = "Select Memory (non-permanent) or Permanent caching", Hidden = HiddenType.Hidden)]
7177
public int RequestCacheType { get; set; } = (int)CacheType.Permanent;
7278

73-
[FieldDefinition(6, Label = "Cache Directory", Type = FieldType.Path, HelpText = "Directory to store cached data (only used for Permanent caching)")]
79+
[FieldDefinition(6, Label = "Cache Directory", Type = FieldType.Path, HelpText = "Directory to store cached data (only used for Permanent caching)", Hidden = HiddenType.Hidden)]
7480
public string CacheDirectory { get; set; } = string.Empty;
7581

76-
[FieldDefinition(7, Label = "Warning", Type = FieldType.Checkbox, HelpText = "Use at your own risk this is not ready and is not in beta but in alpha state")]
82+
[FieldDefinition(7, Label = "Warning", Type = FieldType.Checkbox, HelpText = "Use at your own risk this is not ready and is not in beta but in alpha state", Hidden = HiddenType.Hidden)]
7783
public bool UseAtOwnRisk { get; set; }
7884

7985
public LastfmMetadataProxySettings() => Instance = this;

0 commit comments

Comments
 (0)