Fix Misc Naming in UI and API

pull/145/head
Qstick 7 years ago
parent a6882e7bdd
commit a613dad540

@ -1,6 +1,6 @@
import PropTypes from 'prop-types';
import React from 'react';
import getProgressBarKind from 'Utilities/Series/getProgressBarKind';
import getProgressBarKind from 'Utilities/Artist/getProgressBarKind';
import { sizes } from 'Helpers/Props';
import ProgressBar from 'Components/ProgressBar';
import styles from './ArtistIndexProgressBar.css';

@ -1,6 +1,6 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import getProgressBarKind from 'Utilities/Series/getProgressBarKind';
import getProgressBarKind from 'Utilities/Artist/getProgressBarKind';
import formatBytes from 'Utilities/Number/formatBytes';
import { icons } from 'Helpers/Props';
import IconButton from 'Components/Link/IconButton';

@ -1,5 +1,5 @@
import React from 'react';
import getProgressBarKind from 'Utilities/Series/getProgressBarKind';
import getProgressBarKind from 'Utilities/Artist/getProgressBarKind';
import ProgressBar from 'Components/ProgressBar';
import VirtualTableRowCell from 'Components/Table/Cells/VirtualTableRowCell';
import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellConnector';

@ -2,7 +2,7 @@ import _ from 'lodash';
import $ from 'jquery';
import { batchActions } from 'redux-batched-actions';
import createAjaxRequest from 'Utilities/createAjaxRequest';
import getNewSeries from 'Utilities/Series/getNewSeries';
import getNewArtist from 'Utilities/Artist/getNewArtist';
import * as types from './actionTypes';
import { set, update, updateItem } from './baseActions';
@ -57,7 +57,7 @@ const addArtistActionHandlers = {
const foreignArtistId = payload.foreignArtistId;
const items = getState().addArtist.items;
const newSeries = getNewSeries(_.cloneDeep(_.find(items, { foreignArtistId })), payload);
const newSeries = getNewArtist(_.cloneDeep(_.find(items, { foreignArtistId })), payload);
const promise = $.ajax({
url: '/artist',

@ -1,6 +1,6 @@
import _ from 'lodash';
import $ from 'jquery';
import getMonitoringOptions from 'Utilities/Series/getMonitoringOptions';
import getMonitoringOptions from 'Utilities/Artist/getMonitoringOptions';
import * as types from './actionTypes';
import { set } from './baseActions';
import { fetchArtist } from './artistActions';

@ -1,7 +1,7 @@
import _ from 'lodash';
import $ from 'jquery';
import { batchActions } from 'redux-batched-actions';
import getNewSeries from 'Utilities/Series/getNewSeries';
import getNewArtist from 'Utilities/Artist/getNewArtist';
import * as types from './actionTypes';
import { set, updateItem, removeItem } from './baseActions';
import { startLookupArtist } from './importArtistActions';
@ -117,7 +117,7 @@ const importArtistActionHandlers = {
// Make sure we have a selected artist and
// the same artist hasn't been added yet.
if (selectedArtist && !_.some(acc, { foreignArtistId: selectedArtist.foreignArtistId })) {
const newSeries = getNewSeries(_.cloneDeep(selectedArtist), item);
const newSeries = getNewArtist(_.cloneDeep(selectedArtist), item);
newSeries.path = item.path;
addedIds.push(id);

@ -1,6 +1,6 @@
import getMonitoringOptions from 'Utilities/Series/getMonitoringOptions';
import getMonitoringOptions from 'Utilities/Artist/getMonitoringOptions';
function getNewSeries(artist, payload) {
function getNewArtist(artist, payload) {
const {
rootFolderPath,
monitor,
@ -14,13 +14,11 @@ function getNewSeries(artist, payload) {
} = payload;
const {
// seasons,
options: addOptions
} = getMonitoringOptions(monitor);
addOptions.searchForMissingAlbums = searchForMissingAlbums;
artist.addOptions = addOptions;
// artist.seasons = seasons;
artist.monitored = true;
artist.qualityProfileId = qualityProfileId;
artist.languageProfileId = languageProfileId;
@ -33,4 +31,4 @@ function getNewSeries(artist, payload) {
return artist;
}
export default getNewSeries;
export default getNewArtist;

@ -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();
}

@ -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,

@ -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)
{

Loading…
Cancel
Save