using System; using System.Collections.Generic; using System.Threading.Tasks; using Jellyfin.Data.Entities; using Jellyfin.Data.Enums; using MediaBrowser.Controller.Entities; using MediaBrowser.Model.MediaSegments; namespace MediaBrowser.Controller; /// /// Defines methods for interacting with media segments. /// public interface IMediaSegmentManager { /// /// Returns if this item supports media segments. /// /// The base Item to check. /// True if supported otherwise false. bool IsTypeSupported(BaseItem baseItem); /// /// Creates a new Media Segment associated with an Item. /// /// The segment to create. /// The id of the Provider who created this segment. /// The created Segment entity. Task CreateSegmentAsync(MediaSegmentDto mediaSegment, string segmentProviderId); /// /// Deletes a single media segment. /// /// The to delete. /// a task. Task DeleteSegmentAsync(Guid segmentId); /// /// Obtains all segments accociated with the itemId. /// /// The id of the . /// filteres all media segments of the given type to be included. If null all types are included. /// An enumerator of 's. Task> GetSegmentsAsync(Guid itemId, IEnumerable? typeFilter); /// /// Gets information about any media segments stored for the given itemId. /// /// The id of the . /// True if there are any segments stored for the item, otherwise false. /// TODO: this should be async but as the only caller BaseItem.GetVersionInfo isn't async, this is also not. Venson. bool HasSegments(Guid itemId); }