mirror of
https://gitlab.com/buildfeed/BuildFeed.git
synced 2024-03-22 21:10:34 +08:00
Filter out duplicated results on Bulk Addition
This commit is contained in:
parent
a74137cd66
commit
e1f98079a9
|
@ -225,6 +225,12 @@ public async Task<List<Build>> SelectBuildsByStringSearch(string term, int limit
|
||||||
return await query.ToListAsync();
|
return await query.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DataObjectMethod(DataObjectMethodType.Select, false)]
|
||||||
|
public async Task<Build> SelectBuildByFullBuildString(string build)
|
||||||
|
{
|
||||||
|
return await _buildCollection.Find(Builders<Build>.Filter.Eq(b => b.FullBuildString, build)).SingleOrDefaultAsync();
|
||||||
|
}
|
||||||
|
|
||||||
[DataObjectMethod(DataObjectMethodType.Select, false)]
|
[DataObjectMethod(DataObjectMethodType.Select, false)]
|
||||||
public async Task<List<Build>> SelectBuildsByCompileDate(int limit = -1, int skip = 0)
|
public async Task<List<Build>> SelectBuildsByCompileDate(int limit = -1, int skip = 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -292,6 +292,7 @@
|
||||||
<None Include="package.json" />
|
<None Include="package.json" />
|
||||||
<Content Include="res\Web.config" />
|
<Content Include="res\Web.config" />
|
||||||
<Content Include="res\css\light.scss" />
|
<Content Include="res\css\light.scss" />
|
||||||
|
<None Include="Properties\PublishProfiles\Milestone 1 WebDeploy %28Private%29.pubxml" />
|
||||||
<None Include="Properties\PublishProfiles\Milestone 1 WebDeploy.pubxml" />
|
<None Include="Properties\PublishProfiles\Milestone 1 WebDeploy.pubxml" />
|
||||||
<None Include="Scripts\jquery-3.1.1.intellisense.js" />
|
<None Include="Scripts\jquery-3.1.1.intellisense.js" />
|
||||||
<Content Include="Scripts\jquery-3.1.1.js" />
|
<Content Include="Scripts\jquery-3.1.1.js" />
|
||||||
|
|
|
@ -474,6 +474,11 @@ public async Task<ActionResult> AddBulk(FormCollection values)
|
||||||
SourceType = TypeOfSource.PrivateLeak
|
SourceType = TypeOfSource.PrivateLeak
|
||||||
};
|
};
|
||||||
|
|
||||||
|
string buildString = b.GenerateFullBuildString();
|
||||||
|
Build existing = await _bModel.SelectBuildByFullBuildString(buildString);
|
||||||
|
|
||||||
|
if (existing == null)
|
||||||
|
{
|
||||||
await _bModel.Insert(b);
|
await _bModel.Insert(b);
|
||||||
|
|
||||||
if (notify)
|
if (notify)
|
||||||
|
@ -483,6 +488,11 @@ public async Task<ActionResult> AddBulk(FormCollection values)
|
||||||
|
|
||||||
success.Add(b);
|
success.Add(b);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
failed.Add(line);
|
||||||
|
}
|
||||||
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
failed.Add(line);
|
failed.Add(line);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user