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:
Cody Kickertz 2025-12-21 15:42:10 -06:00 committed by GitHub
parent cde79b6e3b
commit 841128caee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 0 deletions

View file

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

View file

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