more support for episodes directly in a series folder

This commit is contained in:
Luke Pulverenti
2013-12-03 23:18:50 -05:00
parent 61a78e2be9
commit 40959a816f
12 changed files with 231 additions and 32 deletions

View File

@@ -1029,6 +1029,12 @@ namespace MediaBrowser.Server.Implementations.Dto
{
dto.IndexNumberEnd = episode.IndexNumberEnd;
dto.SpecialSeasonNumber = episode.AirsAfterSeasonNumber ?? episode.AirsBeforeSeasonNumber;
var seasonId = episode.SeasonId;
if (seasonId.HasValue)
{
dto.SeasonId = seasonId.Value.ToString("N");
}
}
// Add SeriesInfo

View File

@@ -391,9 +391,16 @@ namespace MediaBrowser.Server.Implementations.LiveTv
Path = info.Path,
Genres = info.Genres,
IsRepeat = info.IsRepeat,
EpisodeTitle = info.EpisodeTitle
EpisodeTitle = info.EpisodeTitle,
ChannelType = info.ChannelType,
MediaType = info.ChannelType == ChannelType.Radio ? MediaType.Audio : MediaType.Video,
CommunityRating = info.CommunityRating,
OfficialRating = info.OfficialRating
};
var duration = info.EndDate - info.StartDate;
dto.DurationMs = Convert.ToInt32(duration.TotalMilliseconds);
if (!string.IsNullOrEmpty(info.ProgramId))
{
dto.ProgramId = GetInternalProgramIdId(service.Name, info.ProgramId).ToString("N");
@@ -510,6 +517,9 @@ namespace MediaBrowser.Server.Implementations.LiveTv
PostPaddingSeconds = info.PostPaddingSeconds
};
var duration = info.EndDate - info.StartDate;
dto.DurationMs = Convert.ToInt32(duration.TotalMilliseconds);
if (!string.IsNullOrEmpty(info.ProgramId))
{
dto.ProgramId = GetInternalProgramIdId(service.Name, info.ProgramId).ToString("N");
@@ -563,5 +573,19 @@ namespace MediaBrowser.Server.Implementations.LiveTv
await service.CancelTimerAsync(timer.ExternalId, CancellationToken.None).ConfigureAwait(false);
}
public async Task<RecordingInfoDto> GetRecording(string id, CancellationToken cancellationToken)
{
var results = await GetRecordings(new RecordingQuery(), cancellationToken).ConfigureAwait(false);
return results.Items.FirstOrDefault(i => string.Equals(i.Id, id, StringComparison.CurrentCulture));
}
public async Task<TimerInfoDto> GetTimer(string id, CancellationToken cancellationToken)
{
var results = await GetTimers(new TimerQuery(), cancellationToken).ConfigureAwait(false);
return results.Items.FirstOrDefault(i => string.Equals(i.Id, id, StringComparison.CurrentCulture));
}
}
}