mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-08-11 09:13:54 -04:00
Enums in response model with no nullability or default value will make the API very fragile as each extension to the enum will break the API for some clients, but a lot of enums actually do have an unknown value which should be used as a default. This set all model properties that are non-nullable using an enum that has an Unknown member in 10.10, except MediaStream.VideoRangeType which is refactored in #13277
38 lines
920 B
C#
38 lines
920 B
C#
using System;
|
|
using System.ComponentModel;
|
|
using Jellyfin.Database.Implementations.Enums;
|
|
|
|
namespace MediaBrowser.Model.MediaSegments;
|
|
|
|
/// <summary>
|
|
/// Api model for MediaSegment's.
|
|
/// </summary>
|
|
public class MediaSegmentDto
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the id of the media segment.
|
|
/// </summary>
|
|
public Guid Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the id of the associated item.
|
|
/// </summary>
|
|
public Guid ItemId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the type of content this segment defines.
|
|
/// </summary>
|
|
[DefaultValue(MediaSegmentType.Unknown)]
|
|
public MediaSegmentType Type { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the start of the segment.
|
|
/// </summary>
|
|
public long StartTicks { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the end of the segment.
|
|
/// </summary>
|
|
public long EndTicks { get; set; }
|
|
}
|