Fix Misc Naming in UI and API

This commit is contained in:
Qstick 2017-11-25 23:55:07 -05:00
commit a613dad540
12 changed files with 22 additions and 32 deletions

View file

@ -22,8 +22,8 @@ namespace Lidarr.Api.V1.Artist
private Response Search()
{
var tvDbResults = _searchProxy.SearchForNewArtist((string)Request.Query.term);
return MapToResource(tvDbResults).AsResponse();
var searchResults = _searchProxy.SearchForNewArtist((string)Request.Query.term);
return MapToResource(searchResults).AsResponse();
}

View file

@ -58,7 +58,6 @@ namespace Lidarr.Api.V1.Artist
public bool Monitored { get; set; }
public string RootFolderPath { get; set; }
//public string Certification { get; set; }
public List<string> Genres { get; set; }
public string CleanName { get; set; }
public string SortName { get; set; }
@ -71,7 +70,7 @@ namespace Lidarr.Api.V1.Artist
//TODO: Add series statistics as a property of the series (instead of individual properties)
}
public static class SeriesResourceMapper
public static class ArtistResourceMapper
{
public static ArtistResource ToResource(this NzbDrone.Core.Music.Artist model)
{
@ -93,7 +92,6 @@ namespace Lidarr.Api.V1.Artist
Images = model.Images,
Albums = model.Albums.ToResource(),
//Year = model.Year,
Path = model.Path,
QualityProfileId = model.ProfileId,
@ -105,12 +103,11 @@ namespace Lidarr.Api.V1.Artist
Monitored = model.Monitored,
LastInfoSync = model.LastInfoSync,
//SeriesType = model.SeriesType,
CleanName = model.CleanName,
ForeignArtistId = model.ForeignArtistId,
NameSlug = model.NameSlug,
RootFolderPath = model.RootFolderPath,
//Certification = model.Certification,
Genres = model.Genres,
Tags = model.Tags,
Added = model.Added,
@ -135,12 +132,8 @@ namespace Lidarr.Api.V1.Artist
Overview = resource.Overview,
//NextAiring
//PreviousAiring
// Network = resource.Network,
//AirTime = resource.AirTime,
Images = resource.Images,
//Albums = resource.Albums.ToModel(),
//Year = resource.Year,
Images = resource.Images,
Path = resource.Path,
ProfileId = resource.QualityProfileId,
@ -152,12 +145,11 @@ namespace Lidarr.Api.V1.Artist
Monitored = resource.Monitored,
LastInfoSync = resource.LastInfoSync,
//SeriesType = resource.SeriesType,
ArtistType = resource.ArtistType,
CleanName = resource.CleanName,
ForeignArtistId = resource.ForeignArtistId,
NameSlug = resource.NameSlug,
RootFolderPath = resource.RootFolderPath,
//Certification = resource.Certification,
Genres = resource.Genres,
Tags = resource.Tags,
Added = resource.Added,

View file

@ -1,4 +1,4 @@
using System.IO;
using System.IO;
using System.Text.RegularExpressions;
using Nancy;
using Nancy.Responses;
@ -12,7 +12,7 @@ namespace Lidarr.Api.V1.MediaCovers
{
private static readonly Regex RegexResizedImage = new Regex(@"-\d+\.jpg$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
private const string MEDIA_COVER_ROUTE = @"/(?<seriesId>\d+)/(?<filename>(.+)\.(jpg|png|gif))";
private const string MEDIA_COVER_ROUTE = @"/(?<artistId>\d+)/(?<filename>(.+)\.(jpg|png|gif))";
private readonly IAppFolderInfo _appFolderInfo;
private readonly IDiskProvider _diskProvider;
@ -22,12 +22,12 @@ namespace Lidarr.Api.V1.MediaCovers
_appFolderInfo = appFolderInfo;
_diskProvider = diskProvider;
Get[MEDIA_COVER_ROUTE] = options => GetMediaCover(options.seriesId, options.filename);
Get[MEDIA_COVER_ROUTE] = options => GetMediaCover(options.artistId, options.filename);
}
private Response GetMediaCover(int seriesId, string filename)
private Response GetMediaCover(int artistId, string filename)
{
var filePath = Path.Combine(_appFolderInfo.GetAppDataPath(), "MediaCover", seriesId.ToString(), filename);
var filePath = Path.Combine(_appFolderInfo.GetAppDataPath(), "MediaCover", artistId.ToString(), filename);
if (!_diskProvider.FileExists(filePath) || _diskProvider.GetFileSize(filePath) == 0)
{