support multiple playlists
This commit is contained in:
@@ -247,7 +247,7 @@ namespace TV_Player
|
|||||||
private static bool TryParseM3ULine(string m3uLine, out M3UInfo? info)
|
private static bool TryParseM3ULine(string m3uLine, out M3UInfo? info)
|
||||||
{
|
{
|
||||||
info = null;
|
info = null;
|
||||||
string pattern = @"#EXTINF:(-?\d+)\s+?(?:timeshift=""(?<Timeshift>.*?)""\s+)?(?:catchup-days=""(?<CatchupDays>.*?)""\s+)?(?:catchup-type=""(?<CatchupType>.*?)""\s+)?(?:CUID=""(?<CUID>.*?)""\s+)?(?:number=""(?<Number>.*?)""\s+)?(?:tvg-id=""(?<TvgID>.*?)""\s+)?(?:tvg-name=""(?<TvgName>.*?)""\s+)?(?:group-title=""(?<GroupTitle>.*?)""\s+)?(?:tvg-logo=""(?<Logo>.*?)""\s*)?(?:group-title=""(?<GroupTitle>.*?)"")?(?:,(?<Name>.*?)\s*\r?\n(?<URL>.*))";
|
string pattern = @"#EXTINF:(-?\d+)\s*?(?:timeshift=""(?<Timeshift>.*?)""\s+)?(?:catchup-days=""(?<CatchupDays>.*?)""\s+)?(?:catchup-type=""(?<CatchupType>.*?)""\s+)?(?:CUID=""(?<CUID>.*?)""\s+)?(?:number=""(?<Number>.*?)""\s+)?(?:tvg-id=""(?<TvgID>.*?)""\s+)?(?:tvg-name=""(?<TvgName>.*?)""\s+)?(?:group-title=""(?<GroupTitle>.*?)""\s+)?(?:tvg-logo=""(?<Logo>.*?)""\s*)?(?:group-title=""(?<GroupTitle>.*?)"")?(?:,(?<Name>.*?)\s*\r?\n(?<URL>.*))";
|
||||||
//string pattern = @"#EXTINF:(-?\d+)\s+?(?:timeshift=""(?<Timeshift>.*?)""\s+)?(?:catchup-days=""(?<CatchupDays>.*?)""\s+)?(?:catchup-type=""(?<CatchupType>.*?)""\s+)?(?:CUID=""(?<CUID>.*?)""\s+)?(?:number=""(?<Number>.*?)""\s+)?(?:tvg-id=""(?<TvgID>.*?)""\s+)?(?:tvg-name=""(?<TvgName>.*?)""\s+)?(?:group-title=""(?<GroupTitle>.*?)""\s+)?(?:tvg-logo=""(?<Logo>.*?)"")?,(?<Name>.*?)\s*\r?\n(?<URL>.*)";
|
//string pattern = @"#EXTINF:(-?\d+)\s+?(?:timeshift=""(?<Timeshift>.*?)""\s+)?(?:catchup-days=""(?<CatchupDays>.*?)""\s+)?(?:catchup-type=""(?<CatchupType>.*?)""\s+)?(?:CUID=""(?<CUID>.*?)""\s+)?(?:number=""(?<Number>.*?)""\s+)?(?:tvg-id=""(?<TvgID>.*?)""\s+)?(?:tvg-name=""(?<TvgName>.*?)""\s+)?(?:group-title=""(?<GroupTitle>.*?)""\s+)?(?:tvg-logo=""(?<Logo>.*?)"")?,(?<Name>.*?)\s*\r?\n(?<URL>.*)";
|
||||||
Regex regex = new Regex(pattern, RegexOptions.IgnoreCase);
|
Regex regex = new Regex(pattern, RegexOptions.IgnoreCase);
|
||||||
|
|
||||||
@@ -260,7 +260,7 @@ namespace TV_Player
|
|||||||
Number = match.Groups["Number"].Value,
|
Number = match.Groups["Number"].Value,
|
||||||
TvgID = match.Groups["TvgID"].Value,
|
TvgID = match.Groups["TvgID"].Value,
|
||||||
TvgName = match.Groups["TvgName"].Value,
|
TvgName = match.Groups["TvgName"].Value,
|
||||||
GroupTitle = match.Groups["GroupTitle"].Value,
|
GroupTitle = string.IsNullOrEmpty(match.Groups["GroupTitle"].Value)? "undefined":match.Groups["GroupTitle"].Value,
|
||||||
Logo = match.Groups["Logo"].Value,
|
Logo = match.Groups["Logo"].Value,
|
||||||
Name = match.Groups["Name"].Value,
|
Name = match.Groups["Name"].Value,
|
||||||
Url = match.Groups["URL"].Value
|
Url = match.Groups["URL"].Value
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
SelectionChanged="ListBox_SelectionChanged">
|
SelectionChanged="ListBox_SelectionChanged">
|
||||||
<ListBox.ItemsPanel>
|
<ListBox.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<UniformGrid Rows="4" />
|
<UniformGrid Columns="4" />
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ListBox.ItemsPanel>
|
</ListBox.ItemsPanel>
|
||||||
<ListView.ItemTemplate>
|
<ListView.ItemTemplate>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
SelectionChanged="ListBox_SelectionChanged">
|
SelectionChanged="ListBox_SelectionChanged">
|
||||||
<ListBox.ItemsPanel>
|
<ListBox.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<UniformGrid Rows="4" />
|
<UniformGrid Columns="4" VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling"/>
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ListBox.ItemsPanel>
|
</ListBox.ItemsPanel>
|
||||||
<ListView.ItemTemplate>
|
<ListView.ItemTemplate>
|
||||||
|
|||||||
@@ -9,13 +9,14 @@
|
|||||||
<ListView x:Name="programsList" ItemsSource="{Binding Programs}" Background="Transparent" VerticalAlignment="Top" Margin="0,50,0,0"
|
<ListView x:Name="programsList" ItemsSource="{Binding Programs}" Background="Transparent" VerticalAlignment="Top" Margin="0,50,0,0"
|
||||||
SelectionMode="Single" Style="{StaticResource ListBoxView}"
|
SelectionMode="Single" Style="{StaticResource ListBoxView}"
|
||||||
SelectedItem="{Binding SelectedItem}" BorderThickness="0"
|
SelectedItem="{Binding SelectedItem}" BorderThickness="0"
|
||||||
|
SnapsToDevicePixels="True"
|
||||||
PreviewMouseDown="ListView_PreviewMouseDown"
|
PreviewMouseDown="ListView_PreviewMouseDown"
|
||||||
PreviewMouseUp="ListView_PreviewMouseUp"
|
PreviewMouseUp="ListView_PreviewMouseUp"
|
||||||
PreviewMouseMove="ListView_MouseMove"
|
PreviewMouseMove="ListView_MouseMove"
|
||||||
SelectionChanged="ListBox_SelectionChanged">
|
SelectionChanged="ListBox_SelectionChanged">
|
||||||
<ListView.ItemsPanel>
|
<ListView.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<UniformGrid Columns="12" />
|
<UniformGrid Columns="12" VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling"/>
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ListView.ItemsPanel>
|
</ListView.ItemsPanel>
|
||||||
<ListView.ItemTemplate>
|
<ListView.ItemTemplate>
|
||||||
|
|||||||
Reference in New Issue
Block a user