add episode number end to xml metadata

This commit is contained in:
Luke Pulverenti 2013-10-25 10:26:22 -04:00
parent b41bd6d544
commit 5416be3cd0
3 changed files with 24 additions and 2 deletions

View File

@ -71,6 +71,11 @@ namespace MediaBrowser.Providers.Savers
builder.Append("<EpisodeNumber>" + SecurityElement.Escape(episode.IndexNumber.Value.ToString(_usCulture)) + "</EpisodeNumber>");
}
if (episode.IndexNumberEnd.HasValue)
{
builder.Append("<EpisodeNumberEnd>" + SecurityElement.Escape(episode.IndexNumberEnd.Value.ToString(_usCulture)) + "</EpisodeNumberEnd>");
}
if (episode.ParentIndexNumber.HasValue)
{
builder.Append("<SeasonNumber>" + SecurityElement.Escape(episode.ParentIndexNumber.Value.ToString(_usCulture)) + "</SeasonNumber>");
@ -93,7 +98,8 @@ namespace MediaBrowser.Providers.Savers
"FirstAired",
"SeasonNumber",
"EpisodeNumber",
"EpisodeName"
"EpisodeName",
"EpisodeNumberEnd"
});
// Set last refreshed so that the provider doesn't trigger after the file save

View File

@ -123,6 +123,22 @@ namespace MediaBrowser.Providers.TV
break;
}
case "EpisodeNumberEnd":
{
var number = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(number))
{
int num;
if (int.TryParse(number, out num))
{
item.IndexNumberEnd = num;
}
}
break;
}
case "EpisodeName":
{
var name = reader.ReadElementContentAsString();

View File

@ -274,7 +274,7 @@ namespace MediaBrowser.ServerApplication
RegisterSingleInstance<ILibrarySearchEngine>(() => new LuceneSearchEngine(ApplicationPaths, LogManager, LibraryManager));
SessionManager = new SessionManager(UserDataManager, ServerConfigurationManager, Logger, UserRepository);
SessionManager = new SessionManager(UserDataManager, ServerConfigurationManager, Logger, UserRepository, LibraryManager);
RegisterSingleInstance(SessionManager);
HttpServer = await _httpServerCreationTask.ConfigureAwait(false);