Initial commit - HomeStream 0.1.0

This commit is contained in:
administrator 2026-05-10 23:25:29 +02:00
commit c0bb485a58
28 changed files with 2836 additions and 0 deletions

34
Models/Channel.cs Normal file
View file

@ -0,0 +1,34 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace FritzTV.Models;
public enum ChannelKind { TvSd, TvHd, Radio }
public class Channel : INotifyPropertyChanged
{
public required string Name { get; init; }
public required string Url { get; init; }
public required ChannelKind Kind { get; init; }
public int Number { get; set; }
private bool _isFavorite;
public bool IsFavorite
{
get => _isFavorite;
set { if (_isFavorite != value) { _isFavorite = value; OnChanged(); } }
}
private string? _logoPath;
public string? LogoPath
{
get => _logoPath;
set { if (_logoPath != value) { _logoPath = value; OnChanged(); } }
}
public override string ToString() => $"{Number,3}. {Name}";
public event PropertyChangedEventHandler? PropertyChanged;
private void OnChanged([CallerMemberName] string? name = null)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}

12
Models/EpgEvent.cs Normal file
View file

@ -0,0 +1,12 @@
namespace FritzTV.Models;
public class EpgEvent
{
public required string ChannelName { get; init; }
public required string Title { get; init; }
public string? Description { get; init; }
public DateTime StartTime { get; init; }
public TimeSpan Duration { get; init; }
public DateTime EndTime => StartTime + Duration;
public bool IsCurrent => DateTime.Now >= StartTime && DateTime.Now < EndTime;
}