Browse Source

fix sorting episodes without metadata (#353)

pull/354/head
Jason Dove 5 years ago committed by GitHub
parent
commit
f1f09bd4cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CHANGELOG.md
  2. 8
      ErsatzTV.Core/Scheduling/ChronologicalMediaComparer.cs

2
CHANGELOG.md

@ -9,6 +9,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Properly order elements - Properly order elements
- Omit channels with no programmes - Omit channels with no programmes
- Properly identify channels using the format number.etv like `15.etv` - Properly identify channels using the format number.etv like `15.etv`
- Fix sorting episodes without episode metadata
- This bug prevented playouts from building and was most often seen when grouping multi-part episodes, as shows are sorted chronologically before checking for multi-part episodes
## [0.0.55-alpha] - 2021-09-03 ## [0.0.55-alpha] - 2021-09-03
### Fixed ### Fixed

8
ErsatzTV.Core/Scheduling/ChronologicalMediaComparer.cs

@ -66,13 +66,17 @@ namespace ErsatzTV.Core.Scheduling
int episode1 = x switch int episode1 = x switch
{ {
Episode e => e.EpisodeMetadata.Max(em => em.EpisodeNumber), Episode e => e.EpisodeMetadata.HeadOrNone().Match(
em => em.EpisodeNumber,
() => int.MaxValue),
_ => int.MaxValue _ => int.MaxValue
}; };
int episode2 = y switch int episode2 = y switch
{ {
Episode e => e.EpisodeMetadata.Max(em => em.EpisodeNumber), Episode e => e.EpisodeMetadata.HeadOrNone().Match(
em => em.EpisodeNumber,
() => int.MaxValue),
_ => int.MaxValue _ => int.MaxValue
}; };

Loading…
Cancel
Save