Added movie studio to movie details page (#262)

* modified Movie model

* db migration

* ui template modification
This commit is contained in:
Vlad Ilies 2017-01-16 20:57:43 +02:00
parent 75bb2533a3
commit 30d2b41fbb
7 changed files with 36 additions and 2 deletions

View File

@ -35,6 +35,7 @@ namespace NzbDrone.Api.Movie
public int Year { get; set; }
public bool HasFile { get; set; }
public string YouTubeTrailerId { get; set; }
public string Studio { get; set; }
//View & Edit
public string Path { get; set; }
@ -146,7 +147,8 @@ namespace NzbDrone.Api.Movie
AlternativeTitles = model.AlternativeTitles,
Ratings = model.Ratings,
MovieFile = movieFile,
YouTubeTrailerId = model.YouTubeTrailerId
YouTubeTrailerId = model.YouTubeTrailerId,
Studio = model.Studio
};
}
@ -194,7 +196,8 @@ namespace NzbDrone.Api.Movie
AddOptions = resource.AddOptions,
AlternativeTitles = resource.AlternativeTitles,
Ratings = resource.Ratings,
YouTubeTrailerId = resource.YouTubeTrailerId
YouTubeTrailerId = resource.YouTubeTrailerId,
Studio = resource.Studio
};
}

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;
using System.Data;
namespace NzbDrone.Core.Datastore.Migration
{
[Migration(120)]
public class add_studio : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Alter.Table("Movies").AddColumn("Studio").AsString().Nullable();
}
}
}

View File

@ -162,6 +162,11 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
}
}
if (resource.production_companies != null && resource.production_companies.Count() > 0)
{
movie.Studio = resource.production_companies[0].name;
}
return movie;
}

View File

@ -183,6 +183,7 @@
<Compile Include="Datastore\Migration\002_remove_tvrage_imdb_unique_constraint.cs" />
<Compile Include="Datastore\Migration\003_remove_clean_title_from_scene_mapping.cs" />
<Compile Include="Datastore\Migration\004_updated_history.cs" />
<Compile Include="Datastore\Migration\120_add_studio_to_table.cs" />
<Compile Include="Datastore\Migration\119_add_youtube_trailer_id_table .cs" />
<Compile Include="Datastore\Migration\118_update_movie_slug.cs" />
<Compile Include="Datastore\Migration\117_update_movie_file.cs" />

View File

@ -49,6 +49,7 @@ namespace NzbDrone.Core.Tv
public int MovieFileId { get; set; }
public List<string> AlternativeTitles { get; set; }
public string YouTubeTrailerId{ get; set; }
public string Studio { get; set; }
public bool HasFile => MovieFileId > 0;

View File

@ -85,6 +85,7 @@ namespace NzbDrone.Core.Tv
movie.Year = movieInfo.Year;
movie.PhysicalRelease = movieInfo.PhysicalRelease;
movie.YouTubeTrailerId = movieInfo.YouTubeTrailerId;
movie.Studio = movieInfo.Studio;
try
{

View File

@ -6,6 +6,9 @@
<span class="label label-info">{{network}}</span>
{{/if}}
{{#if studio}}
<span class="label label-info">{{studio}}</span>
{{/if}}
<span class="label label-info">{{runtime}} minutes</span>
<span class="label label-info">{{path}}</span>