mirror of
https://github.com/sphildreth/roadie
synced 2025-02-16 13:08:25 +00:00
resolves #28
This commit is contained in:
parent
43e20b9e8e
commit
23b8010f83
4 changed files with 10 additions and 8 deletions
|
@ -9,10 +9,10 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoCompare.Core" Version="1.0.0" />
|
||||
<PackageReference Include="CsvHelper" Version="12.1.2" />
|
||||
<PackageReference Include="CsvHelper" Version="12.1.3" />
|
||||
<PackageReference Include="EFCore.BulkExtensions" Version="3.0.0" />
|
||||
<PackageReference Include="FluentFTP" Version="28.0.0" />
|
||||
<PackageReference Include="Hashids.net" Version="1.2.2" />
|
||||
<PackageReference Include="Hashids.net" Version="1.3.0" />
|
||||
<PackageReference Include="HtmlAgilityPack" Version="1.11.16" />
|
||||
<PackageReference Include="IdSharp.Common" Version="1.0.1" />
|
||||
<PackageReference Include="IdSharp.Tagging" Version="1.0.0-rc3" />
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Hashids.net" Version="1.2.2" />
|
||||
<PackageReference Include="Hashids.net" Version="1.3.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="3.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
||||
|
|
|
@ -293,8 +293,10 @@ namespace Roadie.Api.Services
|
|||
// This is MySQL specific but I can't figure out how else to get random without throwing EF local evaluate warnings.
|
||||
var sql = @"SELECT t.id
|
||||
FROM `track` t
|
||||
# Rated filter
|
||||
WHERE ((t.rating > 0 AND {3} = 1) OR {3} = 0)
|
||||
# Artist is not disliked
|
||||
WHERE ((t.id NOT IN (select tt.id
|
||||
AND ((t.id NOT IN (select tt.id
|
||||
FROM `track` tt
|
||||
JOIN `releasemedia` rm on (tt.releaseMediaId = rm.id)
|
||||
JOIN `userartist` ua on (rm.id = ua.artistId)
|
||||
|
@ -311,13 +313,13 @@ namespace Roadie.Api.Services
|
|||
JOIN `usertrack` ut on (tt.id = ut.trackId)
|
||||
WHERE ut.userId = {1} AND ut.isDisliked = 1)))
|
||||
# If toggled then only favorites
|
||||
OR (t.id IN (select tt.id
|
||||
AND ((t.id IN (select tt.id
|
||||
FROM `track` tt
|
||||
JOIN `usertrack` ut on (tt.id = ut.trackId)
|
||||
WHERE ut.userId = {1} AND ut.isFavorite = 1) AND {2} = 1)
|
||||
WHERE ut.userId = {1} AND ut.isFavorite = 1) AND {2} = 1) OR {2} = 0)
|
||||
order BY RIGHT( HEX( (1<<24) * (1+RAND()) ), 6)
|
||||
LIMIT 0, {0};";
|
||||
randomTrackIds = (from a in DbContext.Releases.FromSqlRaw(sql, randomLimit, userId, request.FilterFavoriteOnly ? "1" : "0")
|
||||
randomTrackIds = (from a in DbContext.Releases.FromSqlRaw(sql, randomLimit, userId, request.FilterFavoriteOnly ? "1" : "0", request.FilterRatedOnly ? "1" : "0")
|
||||
select a.Id).ToArray();
|
||||
rowCount = DbContext.Releases.Count();
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"Roadie.Api": {
|
||||
"commandName": "Project",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Production"
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "http://localhost:5123/"
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue