mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 13:10:13 -07:00
Updated to support Album and Track level Compilations
This commit is contained in:
parent
ad23e8ce9f
commit
118e2dfe93
4 changed files with 32 additions and 0 deletions
|
@ -31,6 +31,8 @@ namespace NzbDrone.Core.Datastore.Migration
|
||||||
|
|
||||||
Create.TableForModel("Albums")
|
Create.TableForModel("Albums")
|
||||||
.WithColumn("AlbumId").AsInt32() // Does this map to collectionId?
|
.WithColumn("AlbumId").AsInt32() // Does this map to collectionId?
|
||||||
|
.WithColumn("CompilationId").AsInt32()
|
||||||
|
.WithColumn("Compilation").AsBoolean()
|
||||||
.WithColumn("Title").AsString()
|
.WithColumn("Title").AsString()
|
||||||
.WithColumn("Year").AsInt32()
|
.WithColumn("Year").AsInt32()
|
||||||
.WithColumn("Image").AsInt32() // Is this needed?
|
.WithColumn("Image").AsInt32() // Is this needed?
|
||||||
|
@ -41,6 +43,8 @@ namespace NzbDrone.Core.Datastore.Migration
|
||||||
Create.TableForModel("Tracks")
|
Create.TableForModel("Tracks")
|
||||||
.WithColumn("ItunesTrackId").AsInt32().Unique()
|
.WithColumn("ItunesTrackId").AsInt32().Unique()
|
||||||
.WithColumn("AlbumId").AsInt32()
|
.WithColumn("AlbumId").AsInt32()
|
||||||
|
.WithColumn("CompilationId").AsInt32().Nullable()
|
||||||
|
.WithColumn("Compilation").AsBoolean().WithDefaultValue("False")
|
||||||
.WithColumn("TrackNumber").AsInt32()
|
.WithColumn("TrackNumber").AsInt32()
|
||||||
.WithColumn("Title").AsString().Nullable()
|
.WithColumn("Title").AsString().Nullable()
|
||||||
.WithColumn("Ignored").AsBoolean().Nullable()
|
.WithColumn("Ignored").AsBoolean().Nullable()
|
||||||
|
@ -61,6 +65,10 @@ namespace NzbDrone.Core.Datastore.Migration
|
||||||
.WithColumn("Size").AsInt64()
|
.WithColumn("Size").AsInt64()
|
||||||
.WithColumn("DateAdded").AsDateTime()
|
.WithColumn("DateAdded").AsDateTime()
|
||||||
.WithColumn("AlbumId").AsInt32(); // How does this impact stand alone tracks?
|
.WithColumn("AlbumId").AsInt32(); // How does this impact stand alone tracks?
|
||||||
|
|
||||||
|
Create.TableForModel("Compilation")
|
||||||
|
.WithColumn("CompilationId").AsInt32().Unique()
|
||||||
|
.WithColumn("ArtistId").AsString().Nullable();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,6 +112,9 @@ namespace NzbDrone.Core.Datastore
|
||||||
.Relationship()
|
.Relationship()
|
||||||
.HasOne(track => track.TrackFile, track => track.TrackFileId);
|
.HasOne(track => track.TrackFile, track => track.TrackFileId);
|
||||||
|
|
||||||
|
Mapper.Entity<Compilation>().RegisterModel("Compilation")
|
||||||
|
.Relationships.AutoMapICollectionOrComplexProperties(); //TODO: Figure out how to map this Table
|
||||||
|
|
||||||
Mapper.Entity<QualityDefinition>().RegisterModel("QualityDefinitions")
|
Mapper.Entity<QualityDefinition>().RegisterModel("QualityDefinitions")
|
||||||
.Ignore(d => d.Weight);
|
.Ignore(d => d.Weight);
|
||||||
|
|
||||||
|
|
19
src/NzbDrone.Core/Music/Compilation.cs
Normal file
19
src/NzbDrone.Core/Music/Compilation.cs
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
using NzbDrone.Core.Datastore;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.Music
|
||||||
|
{
|
||||||
|
public class Compilation : ModelBase
|
||||||
|
{
|
||||||
|
public Compilation()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public int CompilationId { get; set; }
|
||||||
|
public LazyList<Artist> Artists { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -19,6 +19,8 @@ namespace NzbDrone.Core.Music
|
||||||
|
|
||||||
public int ItunesTrackId { get; set; }
|
public int ItunesTrackId { get; set; }
|
||||||
public int AlbumId { get; set; }
|
public int AlbumId { get; set; }
|
||||||
|
public int CompilationId { get; set; }
|
||||||
|
public bool Compilation { get; set; }
|
||||||
public int TrackNumber { get; set; }
|
public int TrackNumber { get; set; }
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
public bool Ignored { get; set; }
|
public bool Ignored { get; set; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue