mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
626 B
19 lines
626 B
using System; |
|
using ErsatzTV.Core.Domain; |
|
|
|
namespace ErsatzTV.Core.Extensions |
|
{ |
|
public static class MediaItemExtensions |
|
{ |
|
public static MediaVersion GetHeadVersion(this MediaItem mediaItem) => |
|
mediaItem switch |
|
{ |
|
Movie m => m.MediaVersions.Head(), |
|
Episode e => e.MediaVersions.Head(), |
|
MusicVideo mv => mv.MediaVersions.Head(), |
|
OtherVideo ov => ov.MediaVersions.Head(), |
|
Song s => s.MediaVersions.Head(), |
|
_ => throw new ArgumentOutOfRangeException(nameof(mediaItem)) |
|
}; |
|
} |
|
}
|
|
|