namespace ytLive.Services;
///
/// Pure filename logic for local recordings (TASK 18). The user-requested naming
/// is ty-yyyymmdd-hhmm-hh2mm2.mp4: ty is the brand marker, the first
/// hhmm is the hour+minute the recording STARTED (saved), and the second
/// hh2mm2 is the hour+minute of the recording's LENGTH. Length is only known
/// when recording ends, so the file is created with a 0000 length and renamed
/// on stop (see ).
///
public static class RecordingFile
{
/// A start placeholder — the length is filled in on stop.
public const string StartLengthSuffix = "0000";
public static string BuildStartName(DateTime start)
=> $"ty-{start:yyyyMMdd}-{start:HHmm}-{StartLengthSuffix}";
/// Final name with the real recording length (fractional hour+minute),
/// e.g. 75 minutes → ty-20260829-1405-0115.mp4.
public static string BuildFinalName(DateTime start, TimeSpan length)
{
var hh2 = (int)length.TotalHours;
var mm2 = length.Minutes;
return $"ty-{start:yyyyMMdd}-{start:HHmm}-{hh2:00}{mm2:00}";
}
}