You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
967 B
36 lines
967 B
3 years ago
|
#/usr/bin/env python3
|
||
|
import io
|
||
|
|
||
|
import requests
|
||
|
import wx
|
||
|
|
||
|
from Channel import Channel
|
||
|
from Utils import get_default_log_url, make_bitmap_from_url
|
||
|
|
||
|
|
||
|
class ChannelProvider:
|
||
|
def __init__(self, providerid: str, channels=list()):
|
||
|
self.m_id = providerid
|
||
|
self.m_logo_url = get_default_log_url(providerid)
|
||
|
self.m_logo: wx.Bitmap = make_bitmap_from_url(self.m_logo_url)
|
||
|
self.m_channels: list[Channel] = channels
|
||
|
|
||
|
def append_channel(self, channel: Channel) -> int:
|
||
|
self.m_channels.append(channel)
|
||
|
return len(self.m_channels)
|
||
|
|
||
|
def get_channels(self) -> list[Channel]:
|
||
|
return self.m_channels
|
||
|
|
||
|
def get_channel_by_index(self, channel_index: int) -> Channel:
|
||
|
return self.m_channels[channel_index]
|
||
|
|
||
|
def get_logo_as_bitmap(self) -> wx.Bitmap:
|
||
|
return self.m_logo
|
||
|
|
||
|
def get_name(self) -> str:
|
||
|
return self.m_id_
|
||
|
|
||
|
def get_logo_url(self) -> str:
|
||
|
links: dict = {'ch-svt1'}
|