mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 14:46:31 +00:00
add MediaHash. Step1
This commit is contained in:
@@ -17,15 +17,21 @@ public static class AnnotationsDbSchemaHolder
|
||||
annotationBuilder.HasTableName(Constants.ANNOTATIONS_TABLENAME)
|
||||
.HasPrimaryKey(x => x.Name)
|
||||
.Association(a => a.Detections, (a, d) => a.Name == d.AnnotationName)
|
||||
.Property(x => x.Time).HasDataType(DataType.Int64).HasConversion(ts => ts.Ticks, t => new TimeSpan(t));
|
||||
.Property(x => x.Time)
|
||||
.HasDataType(DataType.Int64)
|
||||
.HasConversion(ts => ts.Ticks, t => new TimeSpan(t));
|
||||
|
||||
annotationBuilder
|
||||
.Ignore(x => x.Milliseconds)
|
||||
.Ignore(x => x.Classes)
|
||||
.Ignore(x => x.Classes)
|
||||
.Ignore(x => x.ImagePath)
|
||||
.Ignore(x => x.LabelPath)
|
||||
.Ignore(x => x.ThumbPath);
|
||||
.Ignore(x => x.ThumbPath)
|
||||
.Ignore(x => x.ClassName)
|
||||
.Ignore(x => x.Colors)
|
||||
.Ignore(x => x.SplitTile)
|
||||
.Ignore(x => x.IsSplit)
|
||||
.Ignore(x => x.TimeStr);
|
||||
|
||||
builder.Entity<Detection>()
|
||||
.HasTableName(Constants.DETECTIONS_TABLENAME);
|
||||
@@ -38,7 +44,11 @@ public static class AnnotationsDbSchemaHolder
|
||||
.HasConversion(list => JsonConvert.SerializeObject(list), str => JsonConvert.DeserializeObject<List<string>>(str) ?? new List<string>());
|
||||
|
||||
builder.Entity<MediaFile>()
|
||||
.HasTableName(Constants.MEDIAFILE_TABLENAME);
|
||||
.HasTableName(Constants.MEDIAFILE_TABLENAME)
|
||||
.HasPrimaryKey(x => x.Hash)
|
||||
.Association(a => a.Annotations, (mf, a) =>
|
||||
mf.Name == a.OriginalMediaName ||
|
||||
mf.Hash == a.MediaHash);
|
||||
|
||||
builder.Build();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user