Support for Artist Disambiguation and Type

pull/94/head
Qstick 7 years ago
parent 6e4638f7b1
commit ed3b47d76a

@ -48,7 +48,8 @@ class AddNewArtistSearchResult extends Component {
artistName, artistName,
nameSlug, nameSlug,
year, year,
network, disambiguation,
artistType,
status, status,
overview, overview,
albumCount, albumCount,
@ -59,10 +60,10 @@ class AddNewArtistSearchResult extends Component {
} = this.props; } = this.props;
const linkProps = isExistingArtist ? { to: `/artist/${nameSlug}` } : { onPress: this.onPress }; const linkProps = isExistingArtist ? { to: `/artist/${nameSlug}` } : { onPress: this.onPress };
let seasons = '1 Season'; let albums = '1 Album';
if (albumCount > 1) { if (albumCount > 1) {
seasons = `${albumCount} Seasons`; albums = `${albumCount} Albums`;
} }
return ( return (
@ -88,6 +89,11 @@ class AddNewArtistSearchResult extends Component {
<span className={styles.year}>({year})</span> <span className={styles.year}>({year})</span>
} }
{
!!disambiguation &&
<span className={styles.year}>({disambiguation})</span>
}
{ {
isExistingArtist && isExistingArtist &&
<Icon <Icon
@ -108,16 +114,16 @@ class AddNewArtistSearchResult extends Component {
</Label> </Label>
{ {
!!network && !!artistType &&
<Label size={sizes.LARGE}> <Label size={sizes.LARGE}>
{network} {artistType}
</Label> </Label>
} }
{ {
!!albumCount && !!albumCount &&
<Label size={sizes.LARGE}> <Label size={sizes.LARGE}>
{seasons} {albums}
</Label> </Label>
} }
@ -156,7 +162,8 @@ AddNewArtistSearchResult.propTypes = {
artistName: PropTypes.string.isRequired, artistName: PropTypes.string.isRequired,
nameSlug: PropTypes.string.isRequired, nameSlug: PropTypes.string.isRequired,
year: PropTypes.number, year: PropTypes.number,
network: PropTypes.string, disambiguation: PropTypes.string,
artistType: PropTypes.string,
status: PropTypes.string.isRequired, status: PropTypes.string.isRequired,
overview: PropTypes.string, overview: PropTypes.string,
albumCount: PropTypes.number, albumCount: PropTypes.number,

@ -7,7 +7,7 @@
margin-right: 5px; margin-right: 5px;
} }
.overview { .disambiguation {
margin-right: 5px; margin-right: 5px;
color: $disabledColor; color: $disabledColor;
} }

@ -7,6 +7,7 @@ import styles from './ImportArtistName.css';
function ImportArtistName(props) { function ImportArtistName(props) {
const { const {
artistName, artistName,
disambiguation,
// year, // year,
isExistingArtist isExistingArtist
} = props; } = props;
@ -16,6 +17,9 @@ function ImportArtistName(props) {
<div className={styles.artistName}> <div className={styles.artistName}>
{artistName} {artistName}
</div> </div>
<div className={styles.disambiguation}>
{disambiguation}
</div>
{ {
isExistingArtist && isExistingArtist &&
@ -31,6 +35,7 @@ function ImportArtistName(props) {
ImportArtistName.propTypes = { ImportArtistName.propTypes = {
artistName: PropTypes.string.isRequired, artistName: PropTypes.string.isRequired,
disambiguation: PropTypes.string,
// year: PropTypes.number.isRequired, // year: PropTypes.number.isRequired,
isExistingArtist: PropTypes.bool.isRequired isExistingArtist: PropTypes.bool.isRequired
}; };

@ -19,7 +19,7 @@ class ImportArtistSearchResult extends Component {
render() { render() {
const { const {
artistName, artistName,
// overview, disambiguation,
// year, // year,
isExistingArtist isExistingArtist
} = this.props; } = this.props;
@ -31,7 +31,7 @@ class ImportArtistSearchResult extends Component {
> >
<ImportArtistName <ImportArtistName
artistName={artistName} artistName={artistName}
// overview={overview} disambiguation={disambiguation}
// year={year} // year={year}
isExistingArtist={isExistingArtist} isExistingArtist={isExistingArtist}
/> />
@ -43,7 +43,7 @@ class ImportArtistSearchResult extends Component {
ImportArtistSearchResult.propTypes = { ImportArtistSearchResult.propTypes = {
foreignArtistId: PropTypes.string.isRequired, foreignArtistId: PropTypes.string.isRequired,
artistName: PropTypes.string.isRequired, artistName: PropTypes.string.isRequired,
// overview: PropTypes.string.isRequired, disambiguation: PropTypes.string,
// year: PropTypes.number.isRequired, // year: PropTypes.number.isRequired,
isExistingArtist: PropTypes.bool.isRequired, isExistingArtist: PropTypes.bool.isRequired,
onPress: PropTypes.func.isRequired onPress: PropTypes.func.isRequired

@ -158,7 +158,7 @@ class ImportArtistSelectArtist extends Component {
isPopulated && selectedArtist && isPopulated && selectedArtist &&
<ImportArtistName <ImportArtistName
artistName={selectedArtist.artistName} artistName={selectedArtist.artistName}
overview={selectedArtist.overview} disambiguation={selectedArtist.disambiguation}
// year={selectedArtist.year} // year={selectedArtist.year}
isExistingArtist={isExistingArtist} isExistingArtist={isExistingArtist}
/> />
@ -229,7 +229,7 @@ class ImportArtistSelectArtist extends Component {
key={item.foreignArtistId} key={item.foreignArtistId}
foreignArtistId={item.foreignArtistId} foreignArtistId={item.foreignArtistId}
artistName={item.artistName} artistName={item.artistName}
// overview={item.overview} disambiguation={item.disambiguation}
// year={item.year} // year={item.year}
onPress={this.onArtistSelect} onPress={this.onArtistSelect}
/> />

@ -24,6 +24,15 @@ function ArtistIndexSortMenu(props) {
Name Name
</SortMenuItem> </SortMenuItem>
<SortMenuItem
name="artistType"
sortKey={sortKey}
sortDirection={sortDirection}
onPress={onSortSelect}
>
Type
</SortMenuItem>
<SortMenuItem <SortMenuItem
name="qualityProfileId" name="qualityProfileId"
sortKey={sortKey} sortKey={sortKey}

@ -38,6 +38,7 @@
flex: 0 0 150px; flex: 0 0 150px;
} }
.artistType,
.trackCount { .trackCount {
composes: headerCell from 'Components/Table/VirtualTableHeaderCell.css'; composes: headerCell from 'Components/Table/VirtualTableHeaderCell.css';

@ -41,6 +41,7 @@
flex-direction: column; flex-direction: column;
} }
.artistType,
.trackCount { .trackCount {
composes: cell from 'Components/Table/Cells/VirtualTableRowCell.css'; composes: cell from 'Components/Table/Cells/VirtualTableRowCell.css';

@ -66,6 +66,7 @@ class ArtistIndexRow extends Component {
status, status,
artistName, artistName,
nameSlug, nameSlug,
artistType,
qualityProfile, qualityProfile,
languageProfile, languageProfile,
nextAiring, nextAiring,
@ -129,6 +130,17 @@ class ArtistIndexRow extends Component {
); );
} }
if (name === 'artistType') {
return (
<VirtualTableRowCell
key={name}
className={styles[name]}
>
{artistType}
</VirtualTableRowCell>
);
}
if (name === 'qualityProfileId') { if (name === 'qualityProfileId') {
return ( return (
<VirtualTableRowCell <VirtualTableRowCell
@ -282,23 +294,6 @@ class ArtistIndexRow extends Component {
); );
} }
// if (name === 'useSceneNumbering') {
// return (
// <VirtualTableRowCell
// key={name}
// className={styles[name]}
// >
// <CheckInput
// className={styles.checkInput}
// name="useSceneNumbering"
// value={useSceneNumbering}
// isDisabled={true}
// onChange={this.onUseSceneNumberingChange}
// />
// </VirtualTableRowCell>
// );
// }
if (name === 'actions') { if (name === 'actions') {
return ( return (
<VirtualTableRowCell <VirtualTableRowCell
@ -349,6 +344,7 @@ ArtistIndexRow.propTypes = {
status: PropTypes.string.isRequired, status: PropTypes.string.isRequired,
artistName: PropTypes.string.isRequired, artistName: PropTypes.string.isRequired,
nameSlug: PropTypes.string.isRequired, nameSlug: PropTypes.string.isRequired,
artistType: PropTypes.string,
qualityProfile: PropTypes.object.isRequired, qualityProfile: PropTypes.object.isRequired,
languageProfile: PropTypes.object.isRequired, languageProfile: PropTypes.object.isRequired,
nextAiring: PropTypes.string, nextAiring: PropTypes.string,

@ -45,6 +45,13 @@ export const defaultState = {
isVisible: true, isVisible: true,
isModifiable: false isModifiable: false
}, },
{
name: 'artistType',
label: 'Type',
isSortable: true,
isVisible: true,
isModifiable: false
},
{ {
name: 'qualityProfileId', name: 'qualityProfileId',
label: 'Quality Profile', label: 'Quality Profile',

@ -6,7 +6,7 @@ function getNewSeries(series, payload) {
monitor, monitor,
qualityProfileId, qualityProfileId,
languageProfileId, languageProfileId,
// seriesType, artistType,
albumFolder, albumFolder,
tags, tags,
searchForMissingAlbums = false searchForMissingAlbums = false
@ -24,7 +24,7 @@ function getNewSeries(series, payload) {
series.qualityProfileId = qualityProfileId; series.qualityProfileId = qualityProfileId;
series.languageProfileId = languageProfileId; series.languageProfileId = languageProfileId;
series.rootFolderPath = rootFolderPath; series.rootFolderPath = rootFolderPath;
// series.seriesType = seriesType; series.artistType = artistType;
series.albumFolder = albumFolder; series.albumFolder = albumFolder;
series.tags = tags; series.tags = tags;

@ -14,65 +14,11 @@ namespace Lidarr.Api.V3.Artist
//Todo: Is there an easy way to keep IgnoreArticlesWhenSorting in sync between, Series, History, Missing? //Todo: Is there an easy way to keep IgnoreArticlesWhenSorting in sync between, Series, History, Missing?
//Todo: We should get the entire Profile instead of ID and Name separately //Todo: We should get the entire Profile instead of ID and Name separately
////View Only
//public string Title { get; set; }
////public List<AlternateTitleResource> AlternateTitles { get; set; }
//public string SortTitle { get; set; }
//public int SeasonCount
//{
// get
// {
// if (Seasons == null) return 0;
// return Seasons.Where(s => s.SeasonNumber > 0).Count();
// }
//}
//public int? TotalEpisodeCount { get; set; }
//public int? EpisodeCount { get; set; }
//public int? EpisodeFileCount { get; set; }
//public long? SizeOnDisk { get; set; }
//// V3: replace with Ended
public ArtistStatusType Status { get; set; } public ArtistStatusType Status { get; set; }
public bool Ended => Status == ArtistStatusType.Ended; public bool Ended => Status == ArtistStatusType.Ended;
//public string ProfileName { get; set; }
//public string Overview { get; set; }
//public DateTime? NextAiring { get; set; }
//public DateTime? PreviousAiring { get; set; }
//public string Network { get; set; }
//public string AirTime { get; set; }
//public List<MediaCover> Images { get; set; }
//public string RemotePoster { get; set; }
//public int Year { get; set; }
////View & Edit
//public string Path { get; set; }
//public int QualityProfileId { get; set; }
//public int LanguageProfileId { get; set; }
////Editing Only
//public bool SeasonFolder { get; set; }
//public bool Monitored { get; set; }
//public DateTime? FirstAired { get; set; }
public DateTime? LastInfoSync { get; set; } public DateTime? LastInfoSync { get; set; }
////public SeriesTypes SeriesType { get; set; }
//public string CleanTitle { get; set; }
//public string ImdbId { get; set; }
//public string TitleSlug { get; set; }
//public string RootFolderPath { get; set; }
//public string Certification { get; set; }
//public List<string> Genres { get; set; }
//public HashSet<int> Tags { get; set; }
//public DateTime Added { get; set; }
//public AddSeriesOptions AddOptions { get; set; }
//public Ratings Ratings { get; set; }
public string ArtistName { get; set; } public string ArtistName { get; set; }
public string ForeignArtistId { get; set; } public string ForeignArtistId { get; set; }
@ -81,6 +27,8 @@ namespace Lidarr.Api.V3.Artist
public int DiscogsId { get; set; } public int DiscogsId { get; set; }
public string AllMusicId { get; set; } public string AllMusicId { get; set; }
public string Overview { get; set; } public string Overview { get; set; }
public string ArtistType { get; set; }
public string Disambiguation { get; set; }
public List<Links> Links { get; set; } public List<Links> Links { get; set; }
public int? AlbumCount { get; set; } public int? AlbumCount { get; set; }
@ -136,10 +84,9 @@ namespace Lidarr.Api.V3.Artist
Status = model.Status, Status = model.Status,
Overview = model.Overview, Overview = model.Overview,
//NextAiring ArtistType = model.ArtistType,
//PreviousAiring Disambiguation = model.Disambiguation,
//Network = model.Network,
//AirTime = model.AirTime,
Images = model.Images, Images = model.Images,
Albums = model.Albums.ToResource(), Albums = model.Albums.ToResource(),

@ -0,0 +1,21 @@
using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NzbDrone.Core.Datastore.Migration
{
[Migration(119)]
public class artist_type : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Alter.Table("Artists")
.AddColumn("ArtistType").AsString().Nullable()
.AddColumn("Disambiguation").AsString().Nullable();
}
}
}

@ -14,6 +14,8 @@ namespace NzbDrone.Core.MetadataSource.SkyHook.Resource
public List<string> Genres { get; set; } public List<string> Genres { get; set; }
public string AristUrl { get; set; } public string AristUrl { get; set; }
public string Overview { get; set; } public string Overview { get; set; }
public string Type { get; set; }
public string Disambiguation { get; set; }
public string Id { get; set; } public string Id { get; set; }
public List<ImageResource> Images { get; set; } public List<ImageResource> Images { get; set; }
public List<LinkResource> Links { get; set; } public List<LinkResource> Links { get; set; }

@ -176,7 +176,9 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
artist.Overview = resource.Overview; artist.Overview = resource.Overview;
artist.NameSlug = Parser.Parser.CleanArtistTitle(artist.Name); artist.NameSlug = Parser.Parser.CleanArtistTitle(artist.Name);
artist.CleanName = Parser.Parser.CleanArtistTitle(artist.Name); artist.CleanName = Parser.Parser.CleanArtistTitle(artist.Name);
artist.SortName = SeriesTitleNormalizer.Normalize(artist.Name, 0); artist.SortName = Parser.Parser.NormalizeTitle(artist.Name);
artist.Disambiguation = resource.Disambiguation;
artist.ArtistType = resource.Type;
artist.Images = resource.Images.Select(MapImage).ToList(); artist.Images = resource.Images.Select(MapImage).ToList();
artist.Status = MapArtistStatus(resource.Status); artist.Status = MapArtistStatus(resource.Status);
artist.Ratings = MapRatings(resource.Rating); artist.Ratings = MapRatings(resource.Rating);

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;

@ -34,6 +34,8 @@ namespace NzbDrone.Core.Music
public string CleanName { get; set; } public string CleanName { get; set; }
public string SortName { get; set; } public string SortName { get; set; }
public string Overview { get; set; } public string Overview { get; set; }
public string Disambiguation { get; set; }
public string ArtistType { get; set; }
public bool Monitored { get; set; } public bool Monitored { get; set; }
public bool AlbumFolder { get; set; } public bool AlbumFolder { get; set; }
public DateTime? LastInfoSync { get; set; } public DateTime? LastInfoSync { get; set; }

@ -80,6 +80,8 @@ namespace NzbDrone.Core.Music
artist.Images = artistInfo.Images; artist.Images = artistInfo.Images;
artist.Genres = artistInfo.Genres; artist.Genres = artistInfo.Genres;
artist.Links = artistInfo.Links; artist.Links = artistInfo.Links;
artist.Disambiguation = artistInfo.Disambiguation;
artist.ArtistType = artistInfo.ArtistType;
try try
{ {

@ -293,6 +293,7 @@
</Compile> </Compile>
<Compile Include="Datastore\Migration\105_rename_torrent_downloadstation.cs" /> <Compile Include="Datastore\Migration\105_rename_torrent_downloadstation.cs" />
<Compile Include="Datastore\Migration\111_create_language_profiles.cs" /> <Compile Include="Datastore\Migration\111_create_language_profiles.cs" />
<Compile Include="Datastore\Migration\119_artist_type.cs" />
<Compile Include="Datastore\Migration\118_history_trackid.cs" /> <Compile Include="Datastore\Migration\118_history_trackid.cs" />
<Compile Include="Datastore\Migration\117_artist_links.cs" /> <Compile Include="Datastore\Migration\117_artist_links.cs" />
<Compile Include="Datastore\Migration\116_change_drone_factory_variable_name.cs" /> <Compile Include="Datastore\Migration\116_change_drone_factory_variable_name.cs" />

Loading…
Cancel
Save