feat: Implement Playlists and Programs Management
- Added PlaylistsGroupViewModel to manage playlists and selection. - Introduced ProgramsGroupViewModel for handling program groups and subscriptions. - Created ProgramsListViewModel to manage individual program listings. - Developed SettingsViewModel for user settings including playlist management. - Implemented TVPlayerViewModel as the main view model coordinating screens and data. - Added PlayerView for video playback with LibVLC integration. - Created XAML views for PlaylistsGroup, ProgramsGroup, ProgramsList, and Settings. - Added sample M3U playlist for testing. - Documented WPF build instructions and project structure in WPF-BUILD.md. - Configured global.json for .NET SDK versioning.
This commit is contained in:
@@ -21,17 +21,33 @@ namespace TV_Player
|
||||
|
||||
private async Task GetPrograms(string name,string m3uLink)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"[ProgramsData] Starting download of: {m3uLink}");
|
||||
//string m3uLink = "http://pl.da-tv.vip/a71e77fa/835b3216/tv.m3u";
|
||||
var result = await M3UParser.DownloadM3UFromWebAsync(m3uLink);
|
||||
try
|
||||
{
|
||||
var result = await M3UParser.DownloadM3UFromWebAsync(m3uLink);
|
||||
System.Diagnostics.Debug.WriteLine($"[ProgramsData] Downloaded {result.programList.Count} programs");
|
||||
|
||||
programsSubject.OnNext(result.programList);
|
||||
programsSubject.OnNext(result.programList);
|
||||
|
||||
var groupping = result.programList.GroupBy(item => item.GroupTitle)
|
||||
.Select(group => new GroupInfo() { Name = group.Key, Count = group.Count() })
|
||||
.ToList();
|
||||
groupsSubject.OnNext(groupping);
|
||||
|
||||
await Task.Run(() => GetProgramGuide(name,result.programGuide));
|
||||
var groupping = result.programList.GroupBy(item => item.GroupTitle)
|
||||
.Select(group => new GroupInfo() { Name = group.Key, Count = group.Count() })
|
||||
.OrderBy(g => g.Name)
|
||||
.ToList();
|
||||
System.Diagnostics.Debug.WriteLine($"[ProgramsData] Publishing {groupping.Count} groups: {string.Join(", ", groupping.Select(g => $"{g.Name}({g.Count})"))}");
|
||||
if (groupping.Count == 0)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("[ProgramsData] WARNING: No groups found! Check if programs have 'group-title' metadata.");
|
||||
}
|
||||
groupsSubject.OnNext(groupping);
|
||||
|
||||
await Task.Run(() => GetProgramGuide(name, result.programGuide));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"[ProgramsData] ERROR downloading programs: {ex.Message}");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public Task<ProgramGuide> GetGuideByProgram(string channelID)
|
||||
|
||||
Reference in New Issue
Block a user