parse list from another source, make file guide
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Reactive.Subjects;
|
||||
using System.Reactive;
|
||||
using System.Reactive.Subjects;
|
||||
|
||||
namespace TV_Player
|
||||
{
|
||||
@@ -6,11 +7,11 @@ namespace TV_Player
|
||||
{
|
||||
private readonly ReplaySubject<List<M3UInfo>> programsSubject = new ReplaySubject<List<M3UInfo>>();
|
||||
private readonly ReplaySubject<List<GroupInfo>> groupsSubject = new ReplaySubject<List<GroupInfo>>();
|
||||
private readonly ReplaySubject<List<ProgramGuide>> programGuideSubject = new ReplaySubject<List<ProgramGuide>>();
|
||||
private readonly ReplaySubject<Unit> programGuideSubject = new ReplaySubject<Unit>();
|
||||
public IObservable<List<M3UInfo>> AllPrograms => programsSubject;
|
||||
public IObservable<List<GroupInfo>> GroupsInformation => groupsSubject;
|
||||
|
||||
public IObservable<List<ProgramGuide>> ProgramGuideInfo => programGuideSubject;
|
||||
public IObservable<Unit> ProgramGuideInfo => programGuideSubject;
|
||||
public ProgramsData()
|
||||
{
|
||||
}
|
||||
@@ -20,17 +21,6 @@ namespace TV_Player
|
||||
//string m3uLink = "http://pl.da-tv.vip/a71e77fa/835b3216/tv.m3u";
|
||||
var result = await M3UParser.DownloadM3UFromWebAsync(m3uLink);
|
||||
|
||||
|
||||
// For how hardcoded add custom channel
|
||||
result.programList.Add(new M3UInfo()
|
||||
{
|
||||
GroupTitle = "Познавательные",
|
||||
Name = "Discovery science",
|
||||
Logo = "http://ip.viks.tv/posts/2018-11/1543603622_discovery_science.png",
|
||||
Number = Convert.ToString(result.programList.Count+1),
|
||||
Url= "https://s2.viks.tv/571/index.m3u8?k=1715093638p791i991i86i78S9b9c0d8fefdcO74ff3ed2f4710c95b07"
|
||||
});;
|
||||
|
||||
programsSubject.OnNext(result.programList);
|
||||
|
||||
var groupping = result.programList.GroupBy(item => item.GroupTitle)
|
||||
@@ -41,11 +31,16 @@ namespace TV_Player
|
||||
await Task.Run(() => GetProgramGuide(result.programGuide));
|
||||
}
|
||||
|
||||
public Task<ProgramGuide> GetGuideByProgram(string channelID)
|
||||
{
|
||||
return M3UParser.ParseEpg(channelID);
|
||||
}
|
||||
|
||||
private async Task GetProgramGuide(string guideLink)
|
||||
{
|
||||
//string guideLink = "http://epg.da-tv.vip/107-light.xml";
|
||||
var programGuide = await M3UParser.DownloadGuideFromWebAsync(guideLink);
|
||||
programGuideSubject.OnNext(programGuide);
|
||||
//guideLink = "http://epg.da-tv.vip/107-light.xml";
|
||||
await M3UParser.DownloadGuideFromWebAsync(guideLink);
|
||||
programGuideSubject.OnNext(Unit.Default);
|
||||
}
|
||||
|
||||
internal void GetData(string playlistURL)
|
||||
|
||||
Reference in New Issue
Block a user