mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-04 10:02:40 +01:00
Calculate proper start time for double episodes
Edit quality profile uses name attribute for switch
This commit is contained in:
parent
2687cd60ed
commit
609c5bfc24
@ -33,6 +33,21 @@ private Response GetEpisodesBetweenStartAndEndDate()
|
||||
if(queryEnd.HasValue) end = DateTime.Parse(queryEnd.Value);
|
||||
|
||||
var episodes = _episodeService.EpisodesBetweenDates(start, end);
|
||||
|
||||
//Todo: This should be done on episode data refresh - because it can be used in multiple places
|
||||
var groups = episodes.GroupBy(e => new { e.SeriesId, e.AirDate }).Where(g => g.Count() > 1).ToList();
|
||||
|
||||
foreach (var group in groups)
|
||||
{
|
||||
//Order by Episode Number
|
||||
int episodeCount = 0;
|
||||
foreach (var episode in group.OrderBy(e => e.SeasonNumber).ThenBy(e => e.EpisodeNumber))
|
||||
{
|
||||
episode.AirDate = episode.AirDate.Value.AddMinutes(episode.Series.Runtime * episodeCount);
|
||||
episodeCount++;
|
||||
}
|
||||
}
|
||||
|
||||
return Mapper.Map<List<Episode>, List<CalendarResource>>(episodes).AsResponse();
|
||||
}
|
||||
}
|
||||
|
@ -40,12 +40,7 @@
|
||||
|
||||
<div class="controls">
|
||||
<div class="switch" data-on-label="Yes" data-off-label="No">
|
||||
{{#if allowed}}
|
||||
<input type="checkbox" checked="checked" />
|
||||
{{else}}
|
||||
<input type="checkbox" />
|
||||
{{/if}}
|
||||
|
||||
<input type="checkbox" name="allowed" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user