handle flat tv folders

pull/702/head
Luke Pulverenti 9 years ago
parent 556024ff40
commit acd2defbf7

@ -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;

@ -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; }

@ -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,74 +1428,70 @@ 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;
}
}
if (fields.Contains(ItemFields.SeriesGenres))
var episodeSeries = episode.Series;
if (episodeSeries != null)
{
var episodeseries = episode.Series;
if (episodeseries != null)
if (fields.Contains(ItemFields.SeriesGenres))
{
dto.SeriesGenres = episodeseries.Genres.ToList();
dto.SeriesGenres = episodeSeries.Genres.ToList();
}
}
}
// Add SeriesInfo
var series = item as Series;
if (series != null)
{
dto.AirDays = series.AirDays;
dto.AirTime = series.AirTime;
dto.SeriesStatus = series.Status;
if (fields.Contains(ItemFields.Settings))
{
dto.DisplaySpecialsWithSeasons = series.DisplaySpecialsWithSeasons;
}
dto.AnimeSeriesIndex = series.AnimeSeriesIndex;
}
if (episode != null)
{
series = episode.Series;
if (series != null)
{
dto.SeriesId = GetDtoId(series);
dto.SeriesName = series.Name;
dto.SeriesId = GetDtoId(episodeSeries);
if (fields.Contains(ItemFields.AirTime))
{
dto.AirTime = series.AirTime;
dto.AirTime = episodeSeries.AirTime;
}
if (options.GetImageLimit(ImageType.Thumb) > 0)
{
dto.SeriesThumbImageTag = GetImageCacheTag(series, ImageType.Thumb);
dto.SeriesThumbImageTag = GetImageCacheTag(episodeSeries, ImageType.Thumb);
}
if (options.GetImageLimit(ImageType.Primary) > 0)
{
dto.SeriesPrimaryImageTag = GetImageCacheTag(series, ImageType.Primary);
dto.SeriesPrimaryImageTag = GetImageCacheTag(episodeSeries, ImageType.Primary);
}
if (fields.Contains(ItemFields.SeriesStudio))
{
dto.SeriesStudio = series.Studios.FirstOrDefault();
dto.SeriesStudio = episodeSeries.Studios.FirstOrDefault();
}
}
}
// Add SeriesInfo
var series = item as Series;
if (series != null)
{
dto.AirDays = series.AirDays;
dto.AirTime = series.AirTime;
dto.SeriesStatus = series.Status;
if (fields.Contains(ItemFields.Settings))
{
dto.DisplaySpecialsWithSeasons = series.DisplaySpecialsWithSeasons;
}
dto.AnimeSeriesIndex = series.AnimeSeriesIndex;
}
// Add SeasonInfo
var season = item as Season;
if (season != null)

@ -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);

@ -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>

Loading…
Cancel
Save