mirror of
https://gitlab.com/buildfeed/BuildFeed.git
synced 2024-03-22 21:10:34 +08:00
IsLeaked Property added, GetWin10Labs API
Also support multi-line source detail fields.
This commit is contained in:
parent
c625bc2a05
commit
38e54126ee
|
@ -219,6 +219,7 @@
|
|||
<Folder Include="App_Data\" />
|
||||
<Folder Include="Areas\admin\Models\" />
|
||||
<Folder Include="Areas\admin\Views\Shared\" />
|
||||
<Folder Include="Models\ApiModel\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="packages.config" />
|
||||
|
|
|
@ -14,5 +14,10 @@ public IEnumerable<Build> GetBuilds()
|
|||
{
|
||||
return Build.SelectInBuildOrder();
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetWin10Labs()
|
||||
{
|
||||
return Build.SelectBuildLabs(6, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,6 +81,22 @@ public class Build : IHasId<long>
|
|||
[EnumDataType(typeof(LevelOfFlight))]
|
||||
public LevelOfFlight FlightLevel { get; set; }
|
||||
|
||||
public bool IsLeaked
|
||||
{
|
||||
get
|
||||
{
|
||||
switch(SourceType)
|
||||
{
|
||||
case TypeOfSource.PublicRelease:
|
||||
case TypeOfSource.InternalLeak:
|
||||
case TypeOfSource.UpdateGDR:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string FullBuildString
|
||||
{
|
||||
get
|
||||
|
@ -186,6 +202,23 @@ public static IEnumerable<string> SelectBuildLabs()
|
|||
}
|
||||
}
|
||||
|
||||
[DataObjectMethod(DataObjectMethodType.Select, false)]
|
||||
public static IEnumerable<string> SelectBuildLabs(byte major, byte minor)
|
||||
{
|
||||
using (RedisClient rClient = new RedisClient(DatabaseConfig.Host, DatabaseConfig.Port, db: DatabaseConfig.Database))
|
||||
{
|
||||
var client = rClient.As<Build>();
|
||||
var results = client.GetAll()
|
||||
.Where(b => !string.IsNullOrWhiteSpace(b.Lab))
|
||||
.Where(b => b.MajorVersion == major)
|
||||
.Where(b => b.MinorVersion == minor)
|
||||
.GroupBy(b => b.Lab.ToLower())
|
||||
.Select(b => b.First().Lab.ToLower())
|
||||
.OrderBy(s => s);
|
||||
return results;
|
||||
}
|
||||
}
|
||||
|
||||
[DataObjectMethod(DataObjectMethodType.Insert, true)]
|
||||
public static void Insert(Build item)
|
||||
{
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<div class="form-group">
|
||||
@Html.LabelFor(model => model.SourceDetails, new { @class = "control-label col-sm-2" })
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">@Html.DisplayFor(model => model.SourceDetails)</p>
|
||||
<p class="form-control-static">@Html.Raw(Html.DisplayFor(model => model.SourceDetails).ToHtmlString().Replace("\r\n", "<br />"))</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user