mirror of
https://github.com/Radarr/Radarr
synced 2026-01-25 00:41:50 +01:00
feat(db): add MediaType discriminator to Movies table (#116)
Adds foundation for multi-media support by: - Adding MediaType column to Movies table (migration 244) - Adding MediaType property to Movie entity, defaulting to Movie Existing movies will have MediaType=1 (Movie) after migration. This prepares for future Book and Audiobook media types. Addresses Issue #1 Co-authored-by: admin <admin@ardentleatherworks.com>
This commit is contained in:
parent
cde79b6e3b
commit
841128caee
2 changed files with 17 additions and 0 deletions
|
|
@ -0,0 +1,14 @@
|
|||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(244)]
|
||||
public class add_mediatype_to_movies : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("Movies").AddColumn("MediaType").AsInt32().WithDefaultValue(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@
|
|||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
using NzbDrone.Core.MediaTypes;
|
||||
using NzbDrone.Core.Profiles.Qualities;
|
||||
|
||||
namespace NzbDrone.Core.Movies
|
||||
|
|
@ -14,9 +15,11 @@ public Movie()
|
|||
{
|
||||
Tags = new HashSet<int>();
|
||||
MovieMetadata = new MovieMetadata();
|
||||
MediaType = MediaType.Movie;
|
||||
}
|
||||
|
||||
public int MovieMetadataId { get; set; }
|
||||
public MediaType MediaType { get; set; }
|
||||
|
||||
public bool Monitored { get; set; }
|
||||
public MovieStatusType MinimumAvailability { get; set; }
|
||||
|
|
|
|||
Loading…
Reference in a new issue