Basic Metadata Polish (#3548)
This commit is contained in:
parent
c0b59d87a4
commit
4c44dbf3e2
20 changed files with 3596 additions and 467 deletions
|
|
@ -21,11 +21,13 @@ public class SeriesBuilder : IEntityBuilder<Series>
|
|||
_series = new Series()
|
||||
{
|
||||
Name = name,
|
||||
|
||||
LocalizedName = name.ToNormalized(),
|
||||
NormalizedLocalizedName = name.ToNormalized(),
|
||||
|
||||
OriginalName = name,
|
||||
SortName = name,
|
||||
NormalizedName = name.ToNormalized(),
|
||||
NormalizedLocalizedName = name.ToNormalized(),
|
||||
Metadata = new SeriesMetadataBuilder()
|
||||
.WithPublicationStatus(PublicationStatus.OnGoing)
|
||||
.Build(),
|
||||
|
|
@ -39,14 +41,25 @@ public class SeriesBuilder : IEntityBuilder<Series>
|
|||
/// </summary>
|
||||
/// <param name="localizedName"></param>
|
||||
/// <returns></returns>
|
||||
public SeriesBuilder WithLocalizedName(string localizedName)
|
||||
public SeriesBuilder WithLocalizedName(string localizedName, bool lockStatus = false)
|
||||
{
|
||||
// Why is this here?
|
||||
if (string.IsNullOrEmpty(localizedName))
|
||||
{
|
||||
localizedName = _series.Name;
|
||||
}
|
||||
|
||||
_series.LocalizedName = localizedName;
|
||||
_series.NormalizedLocalizedName = localizedName.ToNormalized();
|
||||
_series.LocalizedNameLocked = lockStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SeriesBuilder WithLocalizedNameAllowEmpty(string localizedName, bool lockStatus = false)
|
||||
{
|
||||
_series.LocalizedName = localizedName;
|
||||
_series.NormalizedLocalizedName = localizedName.ToNormalized();
|
||||
_series.LocalizedNameLocked = lockStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
@ -106,4 +119,15 @@ public class SeriesBuilder : IEntityBuilder<Series>
|
|||
}
|
||||
|
||||
|
||||
public SeriesBuilder WithRelationship(int targetSeriesId, RelationKind kind)
|
||||
{
|
||||
_series.Relations ??= [];
|
||||
_series.Relations.Add(new SeriesRelation()
|
||||
{
|
||||
RelationKind = kind,
|
||||
TargetSeriesId = targetSeriesId
|
||||
});
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue