implement option to disable audiodb for now

pull/2536/head
dkanada 5 years ago
parent 76e49a1eb7
commit 26c778eb16

@ -102,6 +102,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
}
/// <inheritdoc />
public bool Supports(BaseItem item) => item is MusicAlbum;
public bool Supports(BaseItem item)
=> Plugin.Instance.Configuration.Enable && item is MusicAlbum;
}
}

@ -55,6 +55,12 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
{
var result = new MetadataResult<MusicAlbum>();
// TODO maybe remove when artist metadata can be disabled
if (!Plugin.Instance.Configuration.Enable)
{
return result;
}
var id = info.GetReleaseGroupId();
if (!string.IsNullOrWhiteSpace(id))
@ -78,6 +84,11 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
private void ProcessResult(MusicAlbum item, Album result, string preferredLanguage)
{
if (Plugin.Instance.Configuration.ReplaceAlbumName && !string.IsNullOrWhiteSpace(result.strAlbum))
{
item.Album = result.strAlbum;
}
if (!string.IsNullOrWhiteSpace(result.strArtist))
{
item.AlbumArtists = new string[] { result.strArtist };

@ -143,6 +143,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
}
/// <inheritdoc />
public bool Supports(BaseItem item) => item is MusicArtist;
public bool Supports(BaseItem item)
=> Plugin.Instance.Configuration.Enable && item is MusicArtist;
}
}

@ -56,6 +56,12 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
{
var result = new MetadataResult<MusicArtist>();
// TODO maybe remove when artist metadata can be disabled
if (!Plugin.Instance.Configuration.Enable)
{
return result;
}
var id = info.GetMusicBrainzArtistId();
if (!string.IsNullOrWhiteSpace(id))

@ -5,5 +5,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
public class PluginConfiguration : BasePluginConfiguration
{
public bool Enable { get; set; }
public bool ReplaceAlbumName { get; set; }
}
}

@ -12,6 +12,10 @@
<input is="emby-checkbox" type="checkbox" id="enable" />
<span>Enable this provider for metadata searches on artists and albums.</span>
</label>
<label class="checkboxContainer">
<input is="emby-checkbox" type="checkbox" id="replaceArtistName" />
<span>When an album is found during a metadata search, replace the name with the value on the server.</span>
</label>
<br />
<div>
<button is="emby-button" type="submit" class="raised button-submit block"><span>Save</span></button>

Loading…
Cancel
Save