mirror of
https://github.com/sphildreth/roadie
synced 2024-11-21 19:53:11 +00:00
Work towards using a unified serializer.
This commit is contained in:
parent
f556c28c29
commit
00f6c3b6c4
19 changed files with 151 additions and 64 deletions
|
@ -22,7 +22,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="3.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.5" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.6" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.5" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.6" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
|
||||
|
|
|
@ -11,7 +11,8 @@ namespace Roadie.Library.Caching
|
|||
protected readonly CachePolicy _defaultPolicy;
|
||||
|
||||
protected ILogger Logger { get; }
|
||||
protected ICacheSerializer CacheSerializer { get; }
|
||||
|
||||
public ICacheSerializer CacheSerializer { get; }
|
||||
|
||||
public CacheManagerBase(ILogger logger, ICacheSerializer cacheSerializer, CachePolicy defaultPolicy)
|
||||
{
|
||||
|
|
|
@ -5,6 +5,8 @@ namespace Roadie.Library.Caching
|
|||
{
|
||||
public interface ICacheManager
|
||||
{
|
||||
ICacheSerializer CacheSerializer { get; }
|
||||
|
||||
bool Add<TCacheValue>(string key, TCacheValue value);
|
||||
|
||||
bool Add<TCacheValue>(string key, TCacheValue value, string region);
|
||||
|
|
|
@ -46,10 +46,18 @@ namespace Roadie.Library.Engines
|
|||
|
||||
public IArtistSearchEngine WikipediaArtistSearchEngine { get; }
|
||||
|
||||
public ArtistLookupEngine(IRoadieSettings configuration, IHttpEncoder httpEncoder, IRoadieDbContext context,
|
||||
ICacheManager cacheManager, ILogger<ArtistLookupEngine> logger, musicbrainz.IMusicBrainzProvider musicBrainzProvider,
|
||||
lastfm.ILastFmHelper lastFmHelper, spotify.ISpotifyHelper spotifyHelper, wikipedia.IWikipediaHelper wikipediaHelper,
|
||||
discogs.IDiscogsHelper discogsHelper, IITunesSearchEngine iTunesSearchEngine)
|
||||
public ArtistLookupEngine(
|
||||
IRoadieSettings configuration,
|
||||
IHttpEncoder httpEncoder,
|
||||
IRoadieDbContext context,
|
||||
ICacheManager cacheManager,
|
||||
ILogger<ArtistLookupEngine> logger,
|
||||
musicbrainz.IMusicBrainzProvider musicBrainzProvider,
|
||||
lastfm.ILastFmHelper lastFmHelper,
|
||||
spotify.ISpotifyHelper spotifyHelper,
|
||||
wikipedia.IWikipediaHelper wikipediaHelper,
|
||||
discogs.IDiscogsHelper discogsHelper,
|
||||
IITunesSearchEngine iTunesSearchEngine)
|
||||
: base(configuration, httpEncoder, context, cacheManager, logger)
|
||||
{
|
||||
ITunesArtistSearchEngine = iTunesSearchEngine;
|
||||
|
@ -251,7 +259,7 @@ namespace Roadie.Library.Engines
|
|||
}
|
||||
if (!string.IsNullOrEmpty(releaseRoadieDataFilename) && File.Exists(releaseRoadieDataFilename))
|
||||
{
|
||||
artist = JsonSerializer.Deserialize<Artist>(File.ReadAllText(releaseRoadieDataFilename));
|
||||
artist = CacheManager.CacheSerializer.Deserialize<Artist>(File.ReadAllText(releaseRoadieDataFilename));
|
||||
var addResult = await Add(artist).ConfigureAwait(false);
|
||||
if (!addResult.IsSuccess)
|
||||
{
|
||||
|
|
|
@ -11,11 +11,18 @@ namespace Roadie.Library.Extensions
|
|||
{
|
||||
return null;
|
||||
}
|
||||
return JsonSerializer.Serialize(input, new JsonSerializerOptions
|
||||
try
|
||||
{
|
||||
IgnoreNullValues = true,
|
||||
WriteIndented = true
|
||||
});
|
||||
return JsonSerializer.Serialize(input, new JsonSerializerOptions
|
||||
{
|
||||
IgnoreNullValues = true,
|
||||
WriteIndented = true
|
||||
});
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return input?.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -300,7 +300,7 @@ namespace Roadie.Library.FilePlugins
|
|||
}
|
||||
|
||||
sw.Stop();
|
||||
Logger.LogTrace("<< Audio: Process Complete. Result `{0}`, ElapsedTime [{1}]", JsonSerializer.Serialize(result), sw.ElapsedMilliseconds);
|
||||
Logger.LogTrace("<< Audio: Process Complete. Result `{0}`, ElapsedTime [{1}]", CacheManager.CacheSerializer.Serialize(result), sw.ElapsedMilliseconds);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -369,7 +369,7 @@ namespace Roadie.Library.Inspect
|
|||
var pluginResult = plugin.Process(directoryInfo);
|
||||
if (!pluginResult.IsSuccess)
|
||||
{
|
||||
Console.WriteLine($"📛 Plugin Failed: Error [{JsonSerializer.Serialize(pluginResult)}]");
|
||||
Console.WriteLine($"📛 Plugin Failed: Error [{CacheManager.CacheSerializer.Serialize(pluginResult)}]");
|
||||
return;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(pluginResult.Data))
|
||||
|
@ -404,7 +404,7 @@ namespace Roadie.Library.Inspect
|
|||
{
|
||||
Console.ForegroundColor = ConsoleColor.DarkYellow;
|
||||
Console.WriteLine($"╟ ❗ INVALID: Missing: {ID3TagsHelper.DetermineMissingRequiredMetaData(originalMetaData)}");
|
||||
Console.WriteLine($"╟ [{JsonSerializer.Serialize(tagLib, new JsonSerializerOptions { WriteIndented = true })}]");
|
||||
Console.WriteLine($"╟ [{CacheManager.CacheSerializer.Serialize(tagLib)}]");
|
||||
Console.ResetColor();
|
||||
}
|
||||
|
||||
|
@ -417,7 +417,7 @@ namespace Roadie.Library.Inspect
|
|||
if (!pluginResult.IsSuccess)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.WriteLine($"📛 Plugin Failed: Error [{JsonSerializer.Serialize(pluginResult)}]");
|
||||
Console.WriteLine($"📛 Plugin Failed: Error [{CacheManager.CacheSerializer.Serialize(pluginResult)}]");
|
||||
Console.ResetColor();
|
||||
return;
|
||||
}
|
||||
|
@ -591,7 +591,7 @@ namespace Roadie.Library.Inspect
|
|||
var pluginResult = plugin.Process(directoryInfo);
|
||||
if (!pluginResult.IsSuccess)
|
||||
{
|
||||
Console.WriteLine($"📛 Plugin Failed: Error [{JsonSerializer.Serialize(pluginResult)}]");
|
||||
Console.WriteLine($"📛 Plugin Failed: Error [{CacheManager.CacheSerializer.Serialize(pluginResult)}]");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,28 +13,40 @@ namespace Roadie.Library.Models.Collections
|
|||
public int CollectionCount { get; set; }
|
||||
|
||||
public int? CollectionFoundCount { get; set; }
|
||||
|
||||
public string CollectionType { get; set; }
|
||||
|
||||
public IEnumerable<Comment> Comments { get; set; }
|
||||
[MaxLength(4000)] public string Description { get; set; }
|
||||
|
||||
[MaxLength(200)] public string Edition { get; set; }
|
||||
[MaxLength(4000)]
|
||||
public string Description { get; set; }
|
||||
|
||||
[MaxLength(200)]
|
||||
public string Edition { get; set; }
|
||||
|
||||
public string ListInCSV { get; set; }
|
||||
|
||||
public string ListInCSVFormat { get; set; }
|
||||
|
||||
public DataToken Maintainer { get; set; }
|
||||
|
||||
public Image MediumThumbnail { get; set; }
|
||||
|
||||
public int? MissingReleaseCount
|
||||
{
|
||||
get
|
||||
{
|
||||
if (CollectionCount == 0 || (CollectionFoundCount ?? 0) == 0) return null;
|
||||
if (CollectionCount == 0 || (CollectionFoundCount ?? 0) == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return CollectionCount - CollectionFoundCount;
|
||||
}
|
||||
}
|
||||
|
||||
[MaxLength(100)] public string Name { get; set; }
|
||||
[MaxLength(100)]
|
||||
public string Name { get; set; }
|
||||
|
||||
// When populated a "data:image" base64 byte array of an image to use as new Thumbnail
|
||||
public string NewThumbnailData { get; set; }
|
||||
|
@ -43,15 +55,21 @@ namespace Roadie.Library.Models.Collections
|
|||
{
|
||||
get
|
||||
{
|
||||
if (CollectionCount == 0 || (CollectionFoundCount ?? 0) == 0) return 0;
|
||||
if (CollectionCount == 0 || (CollectionFoundCount ?? 0) == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (int)Math.Floor((decimal)CollectionFoundCount / CollectionCount * 100);
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<CollectionRelease> Releases { get; set; }
|
||||
|
||||
public CollectionStatistics Statistics { get; set; }
|
||||
public Image Thumbnail { get; set; }
|
||||
public string SortNameValue => string.IsNullOrEmpty(SortName) ? Name : SortName;
|
||||
|
||||
public CollectionStatistics Statistics { get; set; }
|
||||
|
||||
public Image Thumbnail { get; set; }
|
||||
}
|
||||
}
|
|
@ -10,29 +10,29 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="AutoCompare.Core" Version="1.0.0" />
|
||||
<PackageReference Include="CsvHelper" Version="15.0.5" />
|
||||
<PackageReference Include="EFCore.BulkExtensions" Version="3.1.1" />
|
||||
<PackageReference Include="EFCore.BulkExtensions" Version="3.1.5" />
|
||||
<PackageReference Include="FluentFTP" Version="32.4.3" />
|
||||
<PackageReference Include="Hashids.net" Version="1.3.0" />
|
||||
<PackageReference Include="HtmlAgilityPack" Version="1.11.24" />
|
||||
<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="Inflatable.Lastfm" Version="1.2.0" />
|
||||
<PackageReference Include="LiteDB" Version="5.0.8" />
|
||||
<PackageReference Include="Magick.NET-Q16-x64" Version="7.20.0" />
|
||||
<PackageReference Include="Mapster" Version="5.3.2" />
|
||||
<PackageReference Include="MetadataExtractor" Version="2.4.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.5" />
|
||||
<PackageReference Include="Magick.NET-Q16-x64" Version="7.21.1" />
|
||||
<PackageReference Include="Mapster" Version="6.1.0" />
|
||||
<PackageReference Include="MetadataExtractor" Version="2.4.3" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.6" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Redis" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.5" />
|
||||
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="1.3.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.6" />
|
||||
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="1.3.5" />
|
||||
<PackageReference Include="Microsoft.Net.Http.Headers" Version="2.2.8" />
|
||||
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.0.2" />
|
||||
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.0.3" />
|
||||
<PackageReference Include="MimeMapping" Version="1.0.1.30" />
|
||||
<PackageReference Include="NodaTime" Version="3.0.0" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.1.1" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.1.2" />
|
||||
<PackageReference Include="RestSharp" Version="106.11.4" />
|
||||
<PackageReference Include="SixLabors.Core" Version="1.0.0-beta0008" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-beta0007" />
|
||||
|
@ -42,7 +42,7 @@
|
|||
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="4.7.0" />
|
||||
<PackageReference Include="System.Runtime.Caching" Version="4.7.0" />
|
||||
<PackageReference Include="Utf8Json" Version="1.3.7" />
|
||||
<PackageReference Include="z440.atl.core" Version="3.5.0" />
|
||||
<PackageReference Include="z440.atl.core" Version="3.6.0" />
|
||||
<PackageReference Include="zlib.net-mutliplatform" Version="1.0.4" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Hashids.net" Version="1.3.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="3.1.5" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="3.1.6" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.6.0" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.1.5" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.7.1" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -184,7 +184,7 @@ namespace Roadie.Api.Services
|
|||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex,
|
||||
$"Subsonic.Authenticate, Error CheckPassword [{JsonSerializer.Serialize(request)}]");
|
||||
$"Subsonic.Authenticate, Error CheckPassword [{CacheManager.CacheSerializer.Serialize(request)}]");
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -486,7 +486,7 @@ namespace Roadie.Api.Services
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex, "GetAlbum Request [{0}], User [{1}]", JsonSerializer.Serialize(request),
|
||||
Logger.LogError(ex, "GetAlbum Request [{0}], User [{1}]", CacheManager.CacheSerializer.Serialize(request),
|
||||
roadieUser.ToString());
|
||||
}
|
||||
|
||||
|
@ -1075,7 +1075,7 @@ namespace Roadie.Api.Services
|
|||
{
|
||||
return new subsonic.SubsonicOperationResult<subsonic.Response>(
|
||||
subsonic.ErrorCodes.TheRequestedDataWasNotFound,
|
||||
$"Unknown GetMusicDirectory Type [{JsonSerializer.Serialize(request)}], id [{request.id}]");
|
||||
$"Unknown GetMusicDirectory Type [{CacheManager.CacheSerializer.Serialize(request)}], id [{request.id}]");
|
||||
}
|
||||
|
||||
return new subsonic.SubsonicOperationResult<subsonic.Response>
|
||||
|
@ -1791,7 +1791,7 @@ namespace Roadie.Api.Services
|
|||
|
||||
return new subsonic.SubsonicOperationResult<subsonic.Response>(
|
||||
subsonic.ErrorCodes.TheRequestedDataWasNotFound,
|
||||
$"Unknown Star Id [{JsonSerializer.Serialize(request)}]");
|
||||
$"Unknown Star Id [{CacheManager.CacheSerializer.Serialize(request)}]");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1879,7 +1879,7 @@ namespace Roadie.Api.Services
|
|||
|
||||
return new subsonic.SubsonicOperationResult<subsonic.Response>(
|
||||
subsonic.ErrorCodes.TheRequestedDataWasNotFound,
|
||||
$"Unknown Star Id [{JsonSerializer.Serialize(request)}]");
|
||||
$"Unknown Star Id [{CacheManager.CacheSerializer.Serialize(request)}]");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1949,7 +1949,7 @@ namespace Roadie.Api.Services
|
|||
{
|
||||
// Remove tracks from playlist
|
||||
// Not clear from API documentation if this is zero based, wait until someone calls it to get values passed.
|
||||
throw new NotImplementedException($"Request [{JsonSerializer.Serialize(request)}]");
|
||||
throw new NotImplementedException($"Request [{CacheManager.CacheSerializer.Serialize(request)}]");
|
||||
}
|
||||
|
||||
await DbContext.SaveChangesAsync().ConfigureAwait(false);
|
||||
|
|
|
@ -791,7 +791,7 @@ namespace Roadie.Api.Services
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex, "Error In List, Request [{0}], User [{1}]", JsonSerializer.Serialize(request), roadieUser);
|
||||
Logger.LogError(ex, "Error In List, Request [{0}], User [{1}]", CacheManager.CacheSerializer.Serialize(request), roadieUser);
|
||||
return new Library.Models.Pagination.PagedResult<TrackList>
|
||||
{
|
||||
Message = "An Error has occured"
|
||||
|
|
|
@ -593,7 +593,7 @@ namespace Roadie.Api.Services
|
|||
|
||||
result.AdditionalData.Add("Timing", sw.ElapsedMilliseconds);
|
||||
Logger.LogTrace(
|
||||
$"User `{roadieUser}` set rating [{rating}] on TrackId [{trackId}]. Result [{JsonSerializer.Serialize(result)}]");
|
||||
$"User `{roadieUser}` set rating [{rating}] on TrackId [{trackId}]. Result [{CacheManager.CacheSerializer.Serialize(result)}]");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -292,7 +292,7 @@ namespace Roadie.Api.Controllers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex, $"Error In Register. Model [{0}]", JsonSerializer.Serialize(registerModel));
|
||||
Logger.LogError(ex, $"Error In Register. Model [{0}]", CacheManager.CacheSerializer.Serialize(registerModel));
|
||||
}
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
@ -344,7 +344,7 @@ namespace Roadie.Api.Controllers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex, $"Error In ResetPassword. Model [{0}]", JsonSerializer.Serialize(resetPasswordModel));
|
||||
Logger.LogError(ex, $"Error In ResetPassword. Model [{0}]", CacheManager.CacheSerializer.Serialize(resetPasswordModel));
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
|
|
|
@ -146,7 +146,7 @@ namespace Roadie.Api.Controllers
|
|||
};
|
||||
await playActivityService.NowPlayingAsync(user, scrobble).ConfigureAwait(false);
|
||||
sw.Stop();
|
||||
Logger.LogTrace($"StreamTrack ElapsedTime [{sw.ElapsedMilliseconds}], Timings [{JsonSerializer.Serialize(timings)}], StreamInfo `{info?.Data}`");
|
||||
Logger.LogTrace($"StreamTrack ElapsedTime [{sw.ElapsedMilliseconds}], Timings [{CacheManager.CacheSerializer.Serialize(timings)}], StreamInfo `{info?.Data}`");
|
||||
return new EmptyResult();
|
||||
}
|
||||
|
||||
|
|
|
@ -66,6 +66,7 @@ namespace Roadie.Api.Controllers
|
|||
return null;
|
||||
}
|
||||
|
||||
[HttpGet("addChatMessage")]
|
||||
[HttpGet("addChatMessage.view")]
|
||||
[HttpPost("addChatMessage.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -81,6 +82,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result);
|
||||
}
|
||||
|
||||
[HttpGet("createBookmark")]
|
||||
[HttpGet("createBookmark.view")]
|
||||
[HttpPost("createBookmark.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -96,6 +98,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result);
|
||||
}
|
||||
|
||||
[HttpGet("createPlaylist")]
|
||||
[HttpGet("createPlaylist.view")]
|
||||
[HttpPost("createPlaylist.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -112,6 +115,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "playlist");
|
||||
}
|
||||
|
||||
[HttpGet("deleteBookmark")]
|
||||
[HttpGet("deleteBookmark.view")]
|
||||
[HttpPost("deleteBookmark.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -127,6 +131,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result);
|
||||
}
|
||||
|
||||
[HttpGet("deletePlaylist")]
|
||||
[HttpGet("deletePlaylist.view")]
|
||||
[HttpPost("deletePlaylist.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -142,6 +147,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result);
|
||||
}
|
||||
|
||||
[HttpGet("download")]
|
||||
[HttpGet("download.view")]
|
||||
[HttpPost("download.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -174,6 +180,7 @@ namespace Roadie.Api.Controllers
|
|||
return NotFound($"Unknown download id `{request.id}`");
|
||||
}
|
||||
|
||||
[HttpGet("getAlbum")]
|
||||
[HttpGet("getAlbum.view")]
|
||||
[HttpPost("getAlbum.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -189,6 +196,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "album");
|
||||
}
|
||||
|
||||
[HttpGet("getAlbumInfo")]
|
||||
[HttpGet("getAlbumInfo.view")]
|
||||
[HttpPost("getAlbumInfo.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -204,6 +212,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "albumInfo");
|
||||
}
|
||||
|
||||
[HttpGet("getAlbumInfo2")]
|
||||
[HttpGet("getAlbumInfo2.view")]
|
||||
[HttpPost("getAlbumInfo2.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -219,6 +228,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "albumInfo");
|
||||
}
|
||||
|
||||
[HttpGet("getAlbumList")]
|
||||
[HttpGet("getAlbumList.view")]
|
||||
[HttpPost("getAlbumList.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -234,6 +244,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "albumList");
|
||||
}
|
||||
|
||||
[HttpGet("getAlbumList2")]
|
||||
[HttpGet("getAlbumList2.view")]
|
||||
[HttpPost("getAlbumList2.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -249,6 +260,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "albumList");
|
||||
}
|
||||
|
||||
[HttpGet("getArtist")]
|
||||
[HttpGet("getArtist.view")]
|
||||
[HttpPost("getArtist.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -264,6 +276,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "artist");
|
||||
}
|
||||
|
||||
[HttpGet("getArtistInfo")]
|
||||
[HttpGet("getArtistInfo.view")]
|
||||
[HttpPost("getArtistInfo.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -280,6 +293,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "artistInfo");
|
||||
}
|
||||
|
||||
[HttpGet("getArtistInfo2")]
|
||||
[HttpGet("getArtistInfo2.view")]
|
||||
[HttpPost("getArtistInfo2.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -296,6 +310,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "artistInfo2");
|
||||
}
|
||||
|
||||
[HttpGet("getArtists")]
|
||||
[HttpGet("getArtists.view")]
|
||||
[HttpPost("getArtists.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -311,6 +326,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "artists");
|
||||
}
|
||||
|
||||
[HttpGet("getAvatar")]
|
||||
[HttpGet("getAvatar.view")]
|
||||
[HttpPost("getAvatar.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -321,6 +337,7 @@ namespace Roadie.Api.Controllers
|
|||
$"/images/user/{user.RoadieId}/{RoadieSettings.ThumbnailImageSize.Width}/{RoadieSettings.ThumbnailImageSize.Height}");
|
||||
}
|
||||
|
||||
[HttpGet("getBookmarks")]
|
||||
[HttpGet("getBookmarks.view")]
|
||||
[HttpPost("getBookmarks.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -336,6 +353,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "bookmarks");
|
||||
}
|
||||
|
||||
[HttpGet("getChatMessages")]
|
||||
[HttpGet("getChatMessages.view")]
|
||||
[HttpPost("getChatMessages.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -351,6 +369,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "chatMessages");
|
||||
}
|
||||
|
||||
[HttpGet("getCoverArt")]
|
||||
[HttpGet("getCoverArt.view")]
|
||||
[HttpPost("getCoverArt.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -364,7 +383,7 @@ namespace Roadie.Api.Controllers
|
|||
|
||||
if (!result.IsSuccess)
|
||||
{
|
||||
Logger.LogWarning($"GetCoverArt Failed For [{ JsonSerializer.Serialize(request)}]");
|
||||
Logger.LogWarning($"GetCoverArt Failed For [{ CacheManager.CacheSerializer.Serialize(request)}]");
|
||||
return StatusCode((int)HttpStatusCode.InternalServerError);
|
||||
}
|
||||
|
||||
|
@ -375,6 +394,7 @@ namespace Roadie.Api.Controllers
|
|||
result.ETag);
|
||||
}
|
||||
|
||||
[HttpGet("getGenres")]
|
||||
[HttpGet("getGenres.view")]
|
||||
[HttpPost("getGenres.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -384,6 +404,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "genres");
|
||||
}
|
||||
|
||||
[HttpGet("getIndexes")]
|
||||
[HttpGet("getIndexes.view")]
|
||||
[HttpPost("getIndexes.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -399,6 +420,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "indexes");
|
||||
}
|
||||
|
||||
[HttpGet("getLicense")]
|
||||
[HttpGet("getLicense.view")]
|
||||
[HttpPost("getLicense.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -408,6 +430,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "license");
|
||||
}
|
||||
|
||||
[HttpGet("getLyrics")]
|
||||
[HttpGet("getLyrics.view")]
|
||||
[HttpPost("getLyrics.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -417,6 +440,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "lyrics ");
|
||||
}
|
||||
|
||||
[HttpGet("getMusicDirectory")]
|
||||
[HttpGet("getMusicDirectory.view")]
|
||||
[HttpPost("getMusicDirectory.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -432,6 +456,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "directory");
|
||||
}
|
||||
|
||||
[HttpGet("getMusicFolders")]
|
||||
[HttpGet("getMusicFolders.view")]
|
||||
[HttpPost("getMusicFolders.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -441,6 +466,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "musicFolders");
|
||||
}
|
||||
|
||||
[HttpGet("getNowPlaying")]
|
||||
[HttpGet("getNowPlaying.view")]
|
||||
[HttpPost("getNowPlaying.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -456,6 +482,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "nowPlaying");
|
||||
}
|
||||
|
||||
[HttpGet("getPlaylist")]
|
||||
[HttpGet("getPlaylist.view")]
|
||||
[HttpPost("getPlaylist.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -471,6 +498,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "playlist");
|
||||
}
|
||||
|
||||
[HttpGet("getPlaylists")]
|
||||
[HttpGet("getPlaylists.view")]
|
||||
[HttpPost("getPlaylists.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -486,6 +514,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "playlists");
|
||||
}
|
||||
|
||||
[HttpGet("getPlayQueue")]
|
||||
[HttpGet("getPlayQueue.view")]
|
||||
[HttpPost("getPlayQueue.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -506,6 +535,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "playQueue");
|
||||
}
|
||||
|
||||
[HttpGet("getPodcasts")]
|
||||
[HttpGet("getPodcasts.view")]
|
||||
[HttpPost("getPodcasts.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -521,6 +551,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "podcasts");
|
||||
}
|
||||
|
||||
[HttpGet("getRandomSongs")]
|
||||
[HttpGet("getRandomSongs.view")]
|
||||
[HttpPost("getRandomSongs.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -536,6 +567,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "randomSongs");
|
||||
}
|
||||
|
||||
[HttpGet("getSimilarSongs")]
|
||||
[HttpGet("getSimilarSongs.view")]
|
||||
[HttpPost("getSimilarSongs.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -551,6 +583,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "similarSongs");
|
||||
}
|
||||
|
||||
[HttpGet("getSimilarSongs2")]
|
||||
[HttpGet("getSimilarSongs2.view")]
|
||||
[HttpPost("getSimilarSongs2.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -566,6 +599,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "similarSongs2");
|
||||
}
|
||||
|
||||
[HttpGet("getSong")]
|
||||
[HttpGet("getSong.view")]
|
||||
[HttpPost("getSong.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -581,6 +615,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "song");
|
||||
}
|
||||
|
||||
[HttpGet("getSongsByGenre")]
|
||||
[HttpGet("getSongsByGenre.view")]
|
||||
[HttpPost("getSongsByGenre.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -596,6 +631,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "songsByGenre");
|
||||
}
|
||||
|
||||
[HttpGet("getStarred")]
|
||||
[HttpGet("getStarred.view")]
|
||||
[HttpPost("getStarred.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -611,6 +647,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "starred");
|
||||
}
|
||||
|
||||
[HttpGet("getStarred2")]
|
||||
[HttpGet("getStarred2.view")]
|
||||
[HttpPost("getStarred2.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -626,6 +663,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "starred");
|
||||
}
|
||||
|
||||
[HttpGet("getTopSongs")]
|
||||
[HttpGet("getTopSongs.view")]
|
||||
[HttpPost("getTopSongs.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -641,6 +679,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "topSongs");
|
||||
}
|
||||
|
||||
[HttpGet("getUser")]
|
||||
[HttpGet("getUser.view")]
|
||||
[HttpPost("getUser.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -656,6 +695,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "user");
|
||||
}
|
||||
|
||||
[HttpGet("getVideos")]
|
||||
[HttpGet("getVideos.view")]
|
||||
[HttpPost("getVideos.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -665,6 +705,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "videos");
|
||||
}
|
||||
|
||||
[HttpGet("ping")]
|
||||
[HttpGet("ping.view")]
|
||||
[HttpPost("ping.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -687,6 +728,7 @@ namespace Roadie.Api.Controllers
|
|||
"application/xml");
|
||||
}
|
||||
|
||||
[HttpGet("savePlayQueue")]
|
||||
[HttpGet("savePlayQueue.view")]
|
||||
[HttpPost("savePlayQueue.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -734,6 +776,7 @@ namespace Roadie.Api.Controllers
|
|||
/// <summary>
|
||||
/// Returns albums, artists and songs matching the given search criteria. Supports paging through the result.
|
||||
/// </summary>
|
||||
[HttpGet("search")]
|
||||
[HttpGet("search.view")]
|
||||
[HttpPost("search.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -749,6 +792,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "searchResult");
|
||||
}
|
||||
|
||||
[HttpGet("search2")]
|
||||
[HttpGet("search2.view")]
|
||||
[HttpPost("search2.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -764,6 +808,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "searchResult2");
|
||||
}
|
||||
|
||||
[HttpGet("search3")]
|
||||
[HttpGet("search3.view")]
|
||||
[HttpPost("search3.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -779,6 +824,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result, "searchResult3");
|
||||
}
|
||||
|
||||
[HttpGet("setRating")]
|
||||
[HttpGet("setRating.view")]
|
||||
[HttpPost("setRating.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -794,6 +840,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result);
|
||||
}
|
||||
|
||||
[HttpGet("star")]
|
||||
[HttpGet("star.view")]
|
||||
[HttpPost("star.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -809,6 +856,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result);
|
||||
}
|
||||
|
||||
[HttpGet("stream")]
|
||||
[HttpGet("stream.view")]
|
||||
[HttpPost("stream.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -829,6 +877,7 @@ namespace Roadie.Api.Controllers
|
|||
return await StreamTrack(trackId.Value, TrackService, PlayActivityService, SubsonicUser).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[HttpGet("unstar")]
|
||||
[HttpGet("unstar.view")]
|
||||
[HttpPost("unstar.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -844,6 +893,7 @@ namespace Roadie.Api.Controllers
|
|||
return BuildResponse(request, result);
|
||||
}
|
||||
|
||||
[HttpGet("updatePlaylist")]
|
||||
[HttpGet("updatePlaylist.view")]
|
||||
[HttpPost("updatePlaylist.view")]
|
||||
[ProducesResponseType(200)]
|
||||
|
@ -901,7 +951,8 @@ namespace Roadie.Api.Controllers
|
|||
}
|
||||
else
|
||||
{
|
||||
jsonResult = $"{{ \"subsonic-response\": {{ \"status\":\"{status}\", \"version\": \"{version}\", \"{responseType}\":{((response?.Data != null ? JsonSerializer.Serialize(response.Data.Item) : string.Empty))}}}}}";
|
||||
var responseString = response?.Data != null ? Newtonsoft.Json.JsonConvert.SerializeObject(response.Data.Item) : string.Empty;
|
||||
jsonResult = $"{{ \"subsonic-response\": {{ \"status\":\"{status}\", \"version\": \"{version}\", \"{responseType}\":{ responseString }}}}}";
|
||||
}
|
||||
|
||||
if ((request?.f ?? string.Empty).Equals("jsonp", StringComparison.OrdinalIgnoreCase))
|
||||
|
|
|
@ -29,28 +29,28 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BCrypt-Core" Version="2.0.0" />
|
||||
<PackageReference Include="Mapster" Version="5.3.2" />
|
||||
<PackageReference Include="Mapster" Version="6.1.0" />
|
||||
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.14.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.5" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.5" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.6" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.6" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="3.6.0" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.6.0" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.6.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.5" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.6" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.6" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.3" />
|
||||
<PackageReference Include="Pastel" Version="1.3.2" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
|
||||
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.1.3" />
|
||||
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
|
||||
<PackageReference Include="Serilog.Exceptions" Version="5.5.0" />
|
||||
<PackageReference Include="Serilog.Exceptions" Version="5.6.0" />
|
||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
|
||||
<PackageReference Include="Serilog.Sinks.LiteDB.NetStandard" Version="1.0.14" />
|
||||
<PackageReference Include="Serilog.Sinks.RollingFileAlternate" Version="2.0.9" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.6.0" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.1.5" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.7.1" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
BIN
Roadie.Api/wwwroot/Images/taowk1qhsc751.jpg
Normal file
BIN
Roadie.Api/wwwroot/Images/taowk1qhsc751.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 204 KiB |
Loading…
Reference in a new issue