Basic Metadata Polish (#3548)

This commit is contained in:
Joe Milazzo 2025-02-14 15:23:52 -06:00 committed by GitHub
parent c0b59d87a4
commit 4c44dbf3e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 3596 additions and 467 deletions

View file

@ -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;
}
}