mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-21 22:04:31 -04:00
Added: Add Release Status to Metadata Profile, Default to Official Only (#250)
* Added: Add Release Status to Metadata Profile, Default to Official Only * Fixed: Unit Test and Comparison
This commit is contained in:
@@ -66,23 +66,29 @@ namespace NzbDrone.Core.Profiles.Metadata
|
||||
return _profileRepository.Exists(id);
|
||||
}
|
||||
|
||||
private void AddDefaultProfile(string name, List<PrimaryAlbumType> primAllowed, List<SecondaryAlbumType> secAllowed)
|
||||
private void AddDefaultProfile(string name, List<PrimaryAlbumType> primAllowed, List<SecondaryAlbumType> secAllowed, List<ReleaseStatus> relAllowed)
|
||||
{
|
||||
var primaryTypes = PrimaryAlbumType.All
|
||||
.OrderByDescending(l => l.Name)
|
||||
.Select(v => new ProfilePrimaryAlbumTypeItem { PrimaryAlbumType = v, Allowed = primAllowed.Contains(v) })
|
||||
.ToList();
|
||||
.OrderByDescending(l => l.Name)
|
||||
.Select(v => new ProfilePrimaryAlbumTypeItem {PrimaryAlbumType = v, Allowed = primAllowed.Contains(v)})
|
||||
.ToList();
|
||||
|
||||
var secondaryTypes = SecondaryAlbumType.All
|
||||
.OrderByDescending(l => l.Name)
|
||||
.Select(v => new ProfileSecondaryAlbumTypeItem { SecondaryAlbumType = v, Allowed = secAllowed.Contains(v) })
|
||||
.ToList();
|
||||
.OrderByDescending(l => l.Name)
|
||||
.Select(v => new ProfileSecondaryAlbumTypeItem {SecondaryAlbumType = v, Allowed = secAllowed.Contains(v)})
|
||||
.ToList();
|
||||
|
||||
var releaseStatues = ReleaseStatus.All
|
||||
.OrderByDescending(l => l.Name)
|
||||
.Select(v => new ProfileReleaseStatusItem {ReleaseStatus = v, Allowed = relAllowed.Contains(v)})
|
||||
.ToList();
|
||||
|
||||
var profile = new MetadataProfile
|
||||
{
|
||||
Name = name,
|
||||
PrimaryAlbumTypes = primaryTypes,
|
||||
SecondaryAlbumTypes = secondaryTypes
|
||||
SecondaryAlbumTypes = secondaryTypes,
|
||||
ReleaseStatuses = releaseStatues
|
||||
};
|
||||
|
||||
Add(profile);
|
||||
@@ -97,7 +103,7 @@ namespace NzbDrone.Core.Profiles.Metadata
|
||||
|
||||
_logger.Info("Setting up default metadata profile");
|
||||
|
||||
AddDefaultProfile("Standard", new List<PrimaryAlbumType>{PrimaryAlbumType.Album}, new List<SecondaryAlbumType>{ SecondaryAlbumType.Studio });
|
||||
AddDefaultProfile("Standard", new List<PrimaryAlbumType>{PrimaryAlbumType.Album}, new List<SecondaryAlbumType>{ SecondaryAlbumType.Studio }, new List<ReleaseStatus>{ReleaseStatus.Official});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user