added more episode values to metadata editor

This commit is contained in:
Luke Pulverenti 2013-12-08 15:33:24 -05:00
parent baf6c3efc7
commit 207280197d
6 changed files with 44 additions and 21 deletions

View File

@ -271,6 +271,16 @@ namespace MediaBrowser.Api
item.Overview = request.Overview;
item.Genres = request.Genres;
var episode = item as Episode;
if (episode != null)
{
episode.DvdSeasonNumber = request.DvdSeasonNumber;
episode.DvdEpisodeNumber = request.DvdEpisodeNumber;
episode.AirsAfterSeasonNumber = request.AirsAfterSeasonNumber;
episode.AirsBeforeEpisodeNumber = request.AirsBeforeEpisodeNumber;
episode.AirsBeforeSeasonNumber = request.AirsBeforeSeasonNumber;
}
var hasTags = item as IHasTags;
if (hasTags != null)
{

View File

@ -30,11 +30,20 @@ namespace MediaBrowser.Model.Dto
/// <value>The date created.</value>
public DateTime? DateCreated { get; set; }
public int? AirsBeforeSeasonNumber { get; set; }
public int? AirsAfterSeasonNumber { get; set; }
public int? AirsBeforeEpisodeNumber { get; set; }
/// <summary>
/// Gets or sets the special season number.
/// Gets or sets the DVD season number.
/// </summary>
/// <value>The special season number.</value>
public int? SpecialSeasonNumber { get; set; }
/// <value>The DVD season number.</value>
public int? DvdSeasonNumber { get; set; }
/// <summary>
/// Gets or sets the DVD episode number.
/// </summary>
/// <value>The DVD episode number.</value>
public int? DvdEpisodeNumber { get; set; }
/// <summary>
/// Gets or sets the name of the sort.

View File

@ -1,4 +1,5 @@
using MediaBrowser.Controller.Entities.TV;
using System;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Logging;
@ -40,7 +41,7 @@ namespace MediaBrowser.Providers.TV
}
private static readonly CultureInfo UsCulture = new CultureInfo("en-US");
/// <summary>
/// Fetches the data from XML node.
/// </summary>
@ -148,11 +149,11 @@ namespace MediaBrowser.Providers.TV
if (!string.IsNullOrWhiteSpace(number))
{
int num;
float num;
if (int.TryParse(number, out num))
if (float.TryParse(number, NumberStyles.Any, UsCulture, out num))
{
item.DvdEpisodeNumber = num;
item.DvdEpisodeNumber = Convert.ToInt32(num);
}
}
break;
@ -164,11 +165,11 @@ namespace MediaBrowser.Providers.TV
if (!string.IsNullOrWhiteSpace(number))
{
int num;
float num;
if (int.TryParse(number, out num))
if (float.TryParse(number, NumberStyles.Any, UsCulture, out num))
{
item.DvdSeasonNumber = num;
item.DvdSeasonNumber = Convert.ToInt32(num);
}
}
break;

View File

@ -225,7 +225,7 @@ namespace MediaBrowser.Providers.TV
foreach (var tuple in episodeLookup)
{
if (tuple.Item1 <= 0)
if (tuple.Item1 < 0)
{
// Ignore season zeros
continue;

View File

@ -410,12 +410,11 @@ namespace MediaBrowser.Providers.TV
if (!string.IsNullOrWhiteSpace(val))
{
int rval;
float num;
// int.TryParse is local aware, so it can be probamatic, force us culture
if (int.TryParse(val, NumberStyles.Integer, _usCulture, out rval))
if (float.TryParse(val, NumberStyles.Any, _usCulture, out num))
{
item.DvdEpisodeNumber = rval;
item.DvdEpisodeNumber = Convert.ToInt32(num);
}
}
@ -428,12 +427,11 @@ namespace MediaBrowser.Providers.TV
if (!string.IsNullOrWhiteSpace(val))
{
int rval;
float num;
// int.TryParse is local aware, so it can be probamatic, force us culture
if (int.TryParse(val, NumberStyles.Integer, _usCulture, out rval))
if (float.TryParse(val, NumberStyles.Any, _usCulture, out num))
{
item.DvdSeasonNumber = rval;
item.DvdSeasonNumber = Convert.ToInt32(num);
}
}

View File

@ -1061,7 +1061,12 @@ namespace MediaBrowser.Server.Implementations.Dto
if (episode != null)
{
dto.IndexNumberEnd = episode.IndexNumberEnd;
dto.SpecialSeasonNumber = episode.AirsAfterSeasonNumber ?? episode.AirsBeforeSeasonNumber;
dto.DvdSeasonNumber = episode.DvdSeasonNumber;
dto.DvdEpisodeNumber = episode.DvdEpisodeNumber;
dto.AirsAfterSeasonNumber = episode.AirsAfterSeasonNumber;
dto.AirsBeforeEpisodeNumber = episode.AirsBeforeEpisodeNumber;
dto.AirsBeforeSeasonNumber = episode.AirsBeforeSeasonNumber;
var seasonId = episode.SeasonId;
if (seasonId.HasValue)