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.Overview = request.Overview;
item.Genres = request.Genres; 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; var hasTags = item as IHasTags;
if (hasTags != null) if (hasTags != null)
{ {

View File

@ -30,11 +30,20 @@ namespace MediaBrowser.Model.Dto
/// <value>The date created.</value> /// <value>The date created.</value>
public DateTime? DateCreated { get; set; } public DateTime? DateCreated { get; set; }
public int? AirsBeforeSeasonNumber { get; set; }
public int? AirsAfterSeasonNumber { get; set; }
public int? AirsBeforeEpisodeNumber { get; set; }
/// <summary> /// <summary>
/// Gets or sets the special season number. /// Gets or sets the DVD season number.
/// </summary> /// </summary>
/// <value>The special season number.</value> /// <value>The DVD season number.</value>
public int? SpecialSeasonNumber { get; set; } 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> /// <summary>
/// Gets or sets the name of the sort. /// 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.Persistence;
using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
@ -148,11 +149,11 @@ namespace MediaBrowser.Providers.TV
if (!string.IsNullOrWhiteSpace(number)) 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; break;
@ -164,11 +165,11 @@ namespace MediaBrowser.Providers.TV
if (!string.IsNullOrWhiteSpace(number)) 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; break;

View File

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

View File

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

View File

@ -1061,7 +1061,12 @@ namespace MediaBrowser.Server.Implementations.Dto
if (episode != null) if (episode != null)
{ {
dto.IndexNumberEnd = episode.IndexNumberEnd; 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; var seasonId = episode.SeasonId;
if (seasonId.HasValue) if (seasonId.HasValue)