mirror of
https://github.com/sphildreth/roadie
synced 2024-11-22 12:13:10 +00:00
v20190316.1 Updated all NuGet packages updated to EF 2.2.3
This commit is contained in:
parent
a76b5c586f
commit
ca98411c68
8 changed files with 68 additions and 50 deletions
|
@ -16,7 +16,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="2.3.2" />
|
||||
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="2.3.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
|
|
|
@ -26,7 +26,8 @@ namespace Roadie.Library.Data
|
|||
[Required]
|
||||
public Guid RoadieId { get; set; }
|
||||
|
||||
[Column("status", TypeName = "enum")]
|
||||
|
||||
[Column("status")]
|
||||
public Statuses? Status { get; set; }
|
||||
|
||||
public EntityBase()
|
||||
|
|
|
@ -44,6 +44,15 @@ namespace Roadie.Library.Data
|
|||
{
|
||||
base.OnModelCreating(builder);
|
||||
|
||||
//builder
|
||||
// .Entity<ScanHistory>()
|
||||
// .Property(e => e.Status)
|
||||
// .HasConversion(
|
||||
// v => v.ToString(),
|
||||
// v => string.IsNullOrEmpty(v) ? Statuses.Ok : (Statuses)Enum.Parse(typeof(Statuses), v))
|
||||
// .HasDefaultValue(Statuses.Ok);
|
||||
|
||||
|
||||
//builder
|
||||
// .Entity<Artist>()
|
||||
// .Property(e => e.Status)
|
||||
|
|
|
@ -9,22 +9,22 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CsvHelper" Version="12.1.2" />
|
||||
<PackageReference Include="EFCore.BulkExtensions" Version="2.4.0" />
|
||||
<PackageReference Include="FluentFTP" Version="21.0.0" />
|
||||
<PackageReference Include="EFCore.BulkExtensions" Version="2.4.3" />
|
||||
<PackageReference Include="FluentFTP" Version="23.1.0" />
|
||||
<PackageReference Include="Hashids.net" Version="1.2.2" />
|
||||
<PackageReference Include="HtmlAgilityPack" Version="1.8.14" />
|
||||
<PackageReference Include="HtmlAgilityPack" Version="1.9.2" />
|
||||
<PackageReference Include="IdSharp.Common" Version="1.0.1" />
|
||||
<PackageReference Include="IdSharp.Tagging" Version="1.0.0-rc3" />
|
||||
<PackageReference Include="Inflatable.Lastfm" Version="1.1.0.339" />
|
||||
<PackageReference Include="Mapster" Version="3.3.1" />
|
||||
<PackageReference Include="Mapster" Version="3.3.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.1" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Redis" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
|
||||
<PackageReference Include="MimeMapping" Version="1.0.1.12" />
|
||||
<PackageReference Include="NodaTime" Version="2.4.4" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.1.4" />
|
||||
<PackageReference Include="RestSharp" Version="106.6.7" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.2.0" />
|
||||
<PackageReference Include="RestSharp" Version="106.6.9" />
|
||||
<PackageReference Include="SixLabors.Core" Version="1.0.0-beta0006" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-beta0005" />
|
||||
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta0005" />
|
||||
|
@ -32,7 +32,7 @@
|
|||
<PackageReference Include="System.Drawing.Common" Version="4.5.1" />
|
||||
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="4.5.0" />
|
||||
<PackageReference Include="System.Runtime.Caching" Version="4.5.0" />
|
||||
<PackageReference Include="z440.atl.core" Version="2.5.0" />
|
||||
<PackageReference Include="z440.atl.core" Version="2.6.0" />
|
||||
<PackageReference Include="zlib.net-mutliplatform" Version="1.0.4" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.4.0" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.0.10" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.0.11" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -32,10 +32,12 @@ namespace Roadie.Api.Services
|
|||
LibraryStats result = null;
|
||||
var sw = new Stopwatch();
|
||||
sw.Start();
|
||||
using (var conn = new MySqlConnection(this.Configuration.ConnectionString))
|
||||
try
|
||||
{
|
||||
conn.Open();
|
||||
var sql = @"SELECT rm.releaseMediaCount AS releaseMediaCount, COUNT(r.roadieId) AS releaseCount,
|
||||
using (var conn = new MySqlConnection(this.Configuration.ConnectionString))
|
||||
{
|
||||
conn.Open();
|
||||
var sql = @"SELECT rm.releaseMediaCount AS releaseMediaCount, COUNT(r.roadieId) AS releaseCount,
|
||||
ts.trackCount, ts.trackDuration as TotalTrackDuration, ts.trackSize as TotalTrackSize, ac.artistCount, lc.labelCount, pc.playedCount, uc.userCount, cc.collectionCount, pl.playlistCount
|
||||
FROM `release` r
|
||||
INNER JOIN (
|
||||
|
@ -66,53 +68,59 @@ namespace Roadie.Api.Services
|
|||
INNER JOIN (
|
||||
SELECT COUNT(1) as playlistCount
|
||||
FROM `playlist`) pl;";
|
||||
using (var cmd = new MySqlCommand(sql, conn))
|
||||
{
|
||||
try
|
||||
using (var cmd = new MySqlCommand(sql, conn))
|
||||
{
|
||||
using (var rdr = await cmd.ExecuteReaderAsync())
|
||||
try
|
||||
{
|
||||
if (rdr.HasRows)
|
||||
using (var rdr = await cmd.ExecuteReaderAsync())
|
||||
{
|
||||
while (rdr.Read())
|
||||
if (rdr.HasRows)
|
||||
{
|
||||
result = new LibraryStats
|
||||
while (rdr.Read())
|
||||
{
|
||||
UserCount = SafeParser.ToNumber<int?>(rdr["UserCount"]),
|
||||
CollectionCount = SafeParser.ToNumber<int?>(rdr["CollectionCount"]),
|
||||
PlaylistCount = SafeParser.ToNumber<int?>(rdr["PlaylistCount"]),
|
||||
ArtistCount = SafeParser.ToNumber<int?>(rdr["ArtistCount"]),
|
||||
LabelCount = SafeParser.ToNumber<int?>(rdr["LabelCount"]),
|
||||
ReleaseCount = SafeParser.ToNumber<int?>(rdr["ReleaseCount"]),
|
||||
ReleaseMediaCount = SafeParser.ToNumber<int?>(rdr["ReleaseMediaCount"]),
|
||||
PlayedCount = SafeParser.ToNumber<int?>(rdr["PlayedCount"]),
|
||||
TrackCount = SafeParser.ToNumber<int?>(rdr["TrackCount"]),
|
||||
TotalTrackDuration = SafeParser.ToNumber<long?>(rdr["TotalTrackDuration"]),
|
||||
TotalTrackSize = SafeParser.ToNumber<long?>(rdr["TotalTrackSize"])
|
||||
};
|
||||
result = new LibraryStats
|
||||
{
|
||||
UserCount = SafeParser.ToNumber<int?>(rdr["UserCount"]),
|
||||
CollectionCount = SafeParser.ToNumber<int?>(rdr["CollectionCount"]),
|
||||
PlaylistCount = SafeParser.ToNumber<int?>(rdr["PlaylistCount"]),
|
||||
ArtistCount = SafeParser.ToNumber<int?>(rdr["ArtistCount"]),
|
||||
LabelCount = SafeParser.ToNumber<int?>(rdr["LabelCount"]),
|
||||
ReleaseCount = SafeParser.ToNumber<int?>(rdr["ReleaseCount"]),
|
||||
ReleaseMediaCount = SafeParser.ToNumber<int?>(rdr["ReleaseMediaCount"]),
|
||||
PlayedCount = SafeParser.ToNumber<int?>(rdr["PlayedCount"]),
|
||||
TrackCount = SafeParser.ToNumber<int?>(rdr["TrackCount"]),
|
||||
TotalTrackDuration = SafeParser.ToNumber<long?>(rdr["TotalTrackDuration"]),
|
||||
TotalTrackSize = SafeParser.ToNumber<long?>(rdr["TotalTrackSize"])
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.Logger.LogError(ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
conn.Close();
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.Logger.LogError(ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
conn.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
var lastScan = this.DbContext.ScanHistories.OrderByDescending(x => x.CreatedDate).FirstOrDefault();
|
||||
if (lastScan != null)
|
||||
{
|
||||
result.LastScan = lastScan.CreatedDate;
|
||||
}
|
||||
sw.Stop();
|
||||
|
||||
}
|
||||
var lastScan = this.DbContext.ScanHistories.OrderByDescending(x => x.CreatedDate).FirstOrDefault();
|
||||
if (lastScan != null)
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.LastScan = lastScan.CreatedDate;
|
||||
this.Logger.LogError(ex);
|
||||
}
|
||||
sw.Stop();
|
||||
return new OperationResult<LibraryStats>
|
||||
{
|
||||
IsSuccess = true,
|
||||
IsSuccess = result != null,
|
||||
OperationTime = sw.ElapsedMilliseconds,
|
||||
Data = result
|
||||
};
|
||||
|
|
|
@ -23,18 +23,18 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BCrypt-Core" Version="2.0.0" />
|
||||
<PackageReference Include="Mapster" Version="3.3.1" />
|
||||
<PackageReference Include="Mapster" Version="3.3.2" />
|
||||
<PackageReference Include="Microsoft.AspNet.SignalR" Version="2.4.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.All" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.OData" Version="7.1.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.1" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" />
|
||||
<PackageReference Include="Serilog.Exceptions" Version="5.0.0" />
|
||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.0.1" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
|
||||
<PackageReference Include="Serilog.Sinks.RollingFileAlternate" Version="2.0.9" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.4.0" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.0.10" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.0.11" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
Loading…
Reference in a new issue