aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/LiveTv/IRecordingsManager.cs
blob: b918e2931b8295b787c148ec7ead2b4680c395c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Entities;

namespace MediaBrowser.Controller.LiveTv;

/// <summary>
/// Service responsible for managing LiveTV recordings.
/// </summary>
public interface IRecordingsManager
{
    /// <summary>
    /// Gets the path for the provided timer id.
    /// </summary>
    /// <param name="id">The timer id.</param>
    /// <returns>The recording path, or <c>null</c> if none exists.</returns>
    string? GetActiveRecordingPath(string id);

    /// <summary>
    /// Gets the information for an active recording.
    /// </summary>
    /// <param name="path">The recording path.</param>
    /// <returns>The <see cref="ActiveRecordingInfo"/>, or <c>null</c> if none exists.</returns>
    ActiveRecordingInfo? GetActiveRecordingInfo(string path);

    /// <summary>
    /// Gets the recording folders.
    /// </summary>
    /// <returns>The <see cref="VirtualFolderInfo"/> for each recording folder.</returns>
    IEnumerable<VirtualFolderInfo> GetRecordingFolders();

    /// <summary>
    /// Ensures that the recording folders all exist, and removes unused folders.
    /// </summary>
    /// <returns>Task.</returns>
    Task CreateRecordingFolders();

    /// <summary>
    /// Cancels the recording with the provided timer id, if one is active.
    /// </summary>
    /// <param name="timerId">The timer id.</param>
    /// <param name="timer">The timer.</param>
    void CancelRecording(string timerId, TimerInfo? timer);

    /// <summary>
    /// Records a stream.
    /// </summary>
    /// <param name="recordingInfo">The recording info.</param>
    /// <param name="channel">The channel associated with the recording timer.</param>
    /// <param name="recordingEndDate">The time to stop recording.</param>
    /// <returns>Task representing the recording process.</returns>
    Task RecordStream(ActiveRecordingInfo recordingInfo, BaseItem channel, DateTime recordingEndDate);
}