handle flat tv folders

This commit is contained in:
Luke Pulverenti 2016-05-22 18:37:50 -04:00
parent 556024ff40
commit acd2defbf7
5 changed files with 48 additions and 39 deletions

View File

@ -57,6 +57,10 @@ namespace MediaBrowser.Model.ApiClient
{
existing.RemoteAddress = server.RemoteAddress;
}
if (!string.IsNullOrEmpty(server.ConnectServerId))
{
existing.ConnectServerId = server.ConnectServerId;
}
if (!string.IsNullOrEmpty(server.LocalAddress))
{
existing.LocalAddress = server.LocalAddress;

View File

@ -12,6 +12,7 @@ namespace MediaBrowser.Model.ApiClient
public String Name { get; set; }
public String Id { get; set; }
public String ConnectServerId { get; set; }
public String LocalAddress { get; set; }
public String RemoteAddress { get; set; }
public String ManualAddress { get; set; }

View File

@ -1412,6 +1412,7 @@ namespace MediaBrowser.Server.Implementations.Dto
if (episode != null)
{
dto.IndexNumberEnd = episode.IndexNumberEnd;
dto.SeriesName = episode.SeriesName;
if (fields.Contains(ItemFields.AlternateEpisodeNumbers))
{
@ -1427,23 +1428,50 @@ namespace MediaBrowser.Server.Implementations.Dto
dto.AirsBeforeSeasonNumber = episode.AirsBeforeSeasonNumber;
}
var seasonId = episode.SeasonId;
if (seasonId.HasValue)
{
dto.SeasonId = seasonId.Value.ToString("N");
}
var episodeSeason = episode.Season;
if (episodeSeason != null)
{
dto.SeasonId = episodeSeason.Id.ToString("N");
if (fields.Contains(ItemFields.SeasonName))
{
dto.SeasonName = episodeSeason.Name;
}
}
var episodeSeries = episode.Series;
if (episodeSeries != null)
{
if (fields.Contains(ItemFields.SeriesGenres))
{
var episodeseries = episode.Series;
if (episodeseries != null)
dto.SeriesGenres = episodeSeries.Genres.ToList();
}
dto.SeriesId = GetDtoId(episodeSeries);
if (fields.Contains(ItemFields.AirTime))
{
dto.SeriesGenres = episodeseries.Genres.ToList();
dto.AirTime = episodeSeries.AirTime;
}
if (options.GetImageLimit(ImageType.Thumb) > 0)
{
dto.SeriesThumbImageTag = GetImageCacheTag(episodeSeries, ImageType.Thumb);
}
if (options.GetImageLimit(ImageType.Primary) > 0)
{
dto.SeriesPrimaryImageTag = GetImageCacheTag(episodeSeries, ImageType.Primary);
}
if (fields.Contains(ItemFields.SeriesStudio))
{
dto.SeriesStudio = episodeSeries.Studios.FirstOrDefault();
}
}
}
@ -1464,37 +1492,6 @@ namespace MediaBrowser.Server.Implementations.Dto
dto.AnimeSeriesIndex = series.AnimeSeriesIndex;
}
if (episode != null)
{
series = episode.Series;
if (series != null)
{
dto.SeriesId = GetDtoId(series);
dto.SeriesName = series.Name;
if (fields.Contains(ItemFields.AirTime))
{
dto.AirTime = series.AirTime;
}
if (options.GetImageLimit(ImageType.Thumb) > 0)
{
dto.SeriesThumbImageTag = GetImageCacheTag(series, ImageType.Thumb);
}
if (options.GetImageLimit(ImageType.Primary) > 0)
{
dto.SeriesPrimaryImageTag = GetImageCacheTag(series, ImageType.Primary);
}
if (fields.Contains(ItemFields.SeriesStudio))
{
dto.SeriesStudio = series.Studios.FirstOrDefault();
}
}
}
// Add SeasonInfo
var season = item as Season;
if (season != null)

View File

@ -1,6 +1,9 @@
using MediaBrowser.Controller.Entities.TV;
using System;
using System.IO;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using System.Linq;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
{
@ -37,7 +40,8 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
}
// If the parent is a Season or Series, then this is an Episode if the VideoResolver returns something
if (season != null || args.HasParent<Series>())
// Also handle flat tv folders
if (season != null || args.HasParent<Series>() || string.Equals(args.GetCollectionType(), CollectionType.TvShows, StringComparison.OrdinalIgnoreCase))
{
var episode = ResolveVideo<Episode>(args, false);

View File

@ -356,6 +356,9 @@
<Content Include="dashboard-ui\scripts\supporterkeypage.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\tvlatest.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\wizardlivetvguide.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>