mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-27 01:57:21 +00:00
SceneMappings now have season number
This commit is contained in:
parent
1bcb080666
commit
e4861283b6
5 changed files with 45 additions and 1 deletions
17
NzbDrone.Core/Datastore/Migrations/Migration20121223.cs
Normal file
17
NzbDrone.Core/Datastore/Migrations/Migration20121223.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Data;
|
||||
using Migrator.Framework;
|
||||
using NzbDrone.Common;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migrations
|
||||
{
|
||||
[Migration(20121223)]
|
||||
public class Migration20121223 : NzbDroneMigration
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Database.AddColumn("SceneMappings", new Column("SeasonNumber", DbType.Int32, ColumnProperty.Null));
|
||||
Database.ExecuteNonQuery("UPDATE SceneMappings SET SeasonNumber = -1 WHERE SeasonNumber IS NULL");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -14,5 +14,8 @@ public class SceneMapping
|
|||
|
||||
[JsonProperty(PropertyName = "Title")]
|
||||
public string SceneName { get; set; }
|
||||
|
||||
[JsonProperty(PropertyName = "Season")]
|
||||
public int SeasonNumber { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using Migrator.Framework;
|
||||
|
||||
namespace NzbDrone.Services.Service.Migrations
|
||||
{
|
||||
[Migration(20121223)]
|
||||
public class Migration20121223 : Migration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
Database.AddColumn("SceneMappings", new Column("Season", DbType.Int32, ColumnProperty.Null));
|
||||
Database.ExecuteNonQuery("UPDATE SceneMappings SET Season = -1 WHERE Season IS NULL");
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -69,7 +69,8 @@ public bool Promote(int mappingId)
|
|||
{
|
||||
CleanTitle = pendingItem.CleanTitle,
|
||||
Id = pendingItem.Id,
|
||||
Title = pendingItem.Title
|
||||
Title = pendingItem.Title,
|
||||
Season = -1
|
||||
};
|
||||
|
||||
Insert(mapping);
|
||||
|
|
|
@ -13,5 +13,6 @@ public class SceneMapping
|
|||
public string CleanTitle { get; set; }
|
||||
public int Id { get; set; }
|
||||
public string Title { get; set; }
|
||||
public int Season { get; set; }
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue