Add prelim work for Album Filtering

This commit is contained in:
Qstick 2017-10-07 00:13:00 -04:00
parent 74f91d63f6
commit b963f2aa82
9 changed files with 72 additions and 5 deletions

View File

@ -56,7 +56,6 @@ class AddNewArtistModalContent extends Component {
render() {
const {
artistName,
// year,
overview,
images,
isAdding,
@ -64,8 +63,9 @@ class AddNewArtistModalContent extends Component {
monitor,
qualityProfileId,
languageProfileId,
// seriesType,
albumFolder,
primaryAlbumTypes,
secondaryAlbumTypes,
tags,
showLanguageProfile,
isSmallScreen,
@ -167,6 +167,28 @@ class AddNewArtistModalContent extends Component {
/>
</FormGroup>
<FormGroup>
<FormLabel>Primary Album Types</FormLabel>
<FormInputGroup
type={inputTypes.TEXT}
name="primaryAlbumTypes"
onChange={onInputChange}
{...primaryAlbumTypes}
/>
</FormGroup>
<FormGroup>
<FormLabel>Secondary Album Types</FormLabel>
<FormInputGroup
type={inputTypes.TEXT}
name="secondaryAlbumTypes"
onChange={onInputChange}
{...secondaryAlbumTypes}
/>
</FormGroup>
<FormGroup>
<FormLabel>Tags</FormLabel>
@ -213,7 +235,6 @@ class AddNewArtistModalContent extends Component {
AddNewArtistModalContent.propTypes = {
artistName: PropTypes.string.isRequired,
// year: PropTypes.number.isRequired,
overview: PropTypes.string,
images: PropTypes.arrayOf(PropTypes.object).isRequired,
isAdding: PropTypes.bool.isRequired,
@ -222,8 +243,9 @@ AddNewArtistModalContent.propTypes = {
monitor: PropTypes.object.isRequired,
qualityProfileId: PropTypes.object,
languageProfileId: PropTypes.object,
// seriesType: PropTypes.object.isRequired,
albumFolder: PropTypes.object.isRequired,
primaryAlbumTypes: PropTypes.object.isRequired,
secondaryAlbumTypes: PropTypes.object.isRequired,
tags: PropTypes.object.isRequired,
showLanguageProfile: PropTypes.bool.isRequired,
isSmallScreen: PropTypes.bool.isRequired,

View File

@ -60,6 +60,8 @@ class AddNewArtistModalContentConnector extends Component {
qualityProfileId,
languageProfileId,
albumFolder,
primaryAlbumTypes,
secondaryAlbumTypes,
tags
} = this.props;
@ -70,6 +72,8 @@ class AddNewArtistModalContentConnector extends Component {
qualityProfileId: qualityProfileId.value,
languageProfileId: languageProfileId.value,
albumFolder: albumFolder.value,
primaryAlbumTypes: primaryAlbumTypes.value,
secondaryAlbumTypes: secondaryAlbumTypes.value,
tags: tags.value,
searchForMissingAlbums
});
@ -96,6 +100,8 @@ AddNewArtistModalContentConnector.propTypes = {
qualityProfileId: PropTypes.object,
languageProfileId: PropTypes.object,
albumFolder: PropTypes.object.isRequired,
primaryAlbumTypes: PropTypes.object.isRequired,
secondaryAlbumTypes: PropTypes.object.isRequired,
tags: PropTypes.object.isRequired,
onModalClose: PropTypes.func.isRequired,
setAddArtistDefault: PropTypes.func.isRequired,

View File

@ -23,6 +23,8 @@ export const defaultState = {
qualityProfileId: 0,
languageProfileId: 0,
seriesType: 'standard',
primaryAlbumTypes: 'Studio, Single',
secondaryAlbumTypes: '',
albumFolder: true,
tags: []
}

View File

@ -17,7 +17,7 @@ function createImportArtistItemSelector() {
defaultMonitor: addArtist.defaults.monitor,
defaultQualityProfileId: addArtist.defaults.qualityProfileId,
defaultSeriesType: addArtist.defaults.seriesType,
defaultSeasonFolder: addArtist.defaults.seasonFolder,
defaultSeasonFolder: addArtist.defaults.albumFolder,
...item,
isExistingArtist
};

View File

@ -8,6 +8,8 @@ function getNewSeries(series, payload) {
languageProfileId,
artistType,
albumFolder,
primaryAlbumTypes,
secondaryAlbumTypes,
tags,
searchForMissingAlbums = false
} = payload;
@ -26,6 +28,8 @@ function getNewSeries(series, payload) {
series.rootFolderPath = rootFolderPath;
series.artistType = artistType;
series.albumFolder = albumFolder;
series.primaryAlbumTypes = primaryAlbumTypes;
series.secondaryAlbumTypes = secondaryAlbumTypes;
series.tags = tags;
return series;

View File

@ -29,6 +29,8 @@ namespace Lidarr.Api.V3.Artist
public string Overview { get; set; }
public string ArtistType { get; set; }
public string Disambiguation { get; set; }
public string PrimaryAlbumTypes { get; set; }
public string SecondaryAlbumTypes { get; set; }
public List<Links> Links { get; set; }
public int? AlbumCount { get; set; }
@ -87,6 +89,9 @@ namespace Lidarr.Api.V3.Artist
ArtistType = model.ArtistType,
Disambiguation = model.Disambiguation,
PrimaryAlbumTypes = model.PrimaryAlbumTypes,
SecondaryAlbumTypes = model.SecondaryAlbumTypes,
Images = model.Images,
Albums = model.Albums.ToResource(),
@ -142,6 +147,8 @@ namespace Lidarr.Api.V3.Artist
ProfileId = resource.QualityProfileId,
LanguageProfileId = resource.LanguageProfileId,
Links = resource.Links,
PrimaryAlbumTypes = resource.PrimaryAlbumTypes,
SecondaryAlbumTypes = resource.SecondaryAlbumTypes,
AlbumFolder = resource.AlbumFolder,
Monitored = resource.Monitored,

View File

@ -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(120)]
public class artist_album_types : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Alter.Table("Artists")
.AddColumn("PrimaryAlbumTypes").AsString().Nullable()
.AddColumn("SecondaryAlbumTypes").AsString().Nullable();
}
}
}

View File

@ -36,6 +36,8 @@ namespace NzbDrone.Core.Music
public string Overview { get; set; }
public string Disambiguation { get; set; }
public string ArtistType { get; set; }
public string PrimaryAlbumTypes { get; set; }
public string SecondaryAlbumTypes { get; set; }
public bool Monitored { get; set; }
public bool AlbumFolder { get; set; }
public DateTime? LastInfoSync { get; set; }
@ -73,6 +75,8 @@ namespace NzbDrone.Core.Music
LanguageProfileId = otherArtist.LanguageProfileId;
Albums = otherArtist.Albums;
PrimaryAlbumTypes = otherArtist.PrimaryAlbumTypes;
SecondaryAlbumTypes = otherArtist.SecondaryAlbumTypes;
ProfileId = otherArtist.ProfileId;
Tags = otherArtist.Tags;

View File

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