|
|
@ -15,7 +15,6 @@ from Items import Item
|
|
|
|
HEIGHT = int(1440 / 2)
|
|
|
|
HEIGHT = int(1440 / 2)
|
|
|
|
BTN_HEIGHT = 40
|
|
|
|
BTN_HEIGHT = 40
|
|
|
|
SIZE = wx.Size(68,100)
|
|
|
|
SIZE = wx.Size(68,100)
|
|
|
|
MYPATH = path.dirname(path.abspath(__file__))
|
|
|
|
|
|
|
|
SCREEN_WIDTH = int(720 / 2)
|
|
|
|
SCREEN_WIDTH = int(720 / 2)
|
|
|
|
BASEPATH = path.join(str(environ.get("HOME")), '.config/cast')
|
|
|
|
BASEPATH = path.join(str(environ.get("HOME")), '.config/cast')
|
|
|
|
DB_FILE_NAME = 'cast.db'
|
|
|
|
DB_FILE_NAME = 'cast.db'
|
|
|
@ -68,11 +67,11 @@ def add_video(video_id: str,
|
|
|
|
con.commit()
|
|
|
|
con.commit()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_default_logo(providerid: str = 'default') -> wx.Bitmap:
|
|
|
|
def get_default_logo(providerid: str = 'default', path: str = '/usr/share/cast') -> wx.Bitmap:
|
|
|
|
if providerid == 'SVT':
|
|
|
|
if providerid == 'SVT':
|
|
|
|
return wx.Bitmap('{}/assets/SVT.png'.format(MYPATH))
|
|
|
|
return wx.Bitmap('{}/assets/SVT.png'.format(path))
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
return wx.Bitmap('{}/assets/Default.png'.format(MYPATH))
|
|
|
|
return wx.Bitmap('{}/assets/Default.png'.format(path))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_latest(provider_id: str,
|
|
|
|
def get_latest(provider_id: str,
|
|
|
@ -236,42 +235,42 @@ def make_bitmap_from_file(path, size: wx.Size = SIZE) -> wx.Bitmap:
|
|
|
|
return wx.Bitmap(image)
|
|
|
|
return wx.Bitmap(image)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def resolve_svt_channel(svt_id: str) -> dict:
|
|
|
|
def resolve_svt_channel(svt_id: str, path: str = '/usr/share/cast') -> dict:
|
|
|
|
|
|
|
|
|
|
|
|
channels = {
|
|
|
|
channels = {
|
|
|
|
"ch-barnkanalen": {
|
|
|
|
"ch-barnkanalen": {
|
|
|
|
"name":
|
|
|
|
"name":
|
|
|
|
"Barnkanalen",
|
|
|
|
"Barnkanalen",
|
|
|
|
"thumbnail":
|
|
|
|
"thumbnail":
|
|
|
|
make_bitmap_from_file('{}/assets/Barnkanalen.png'.format(MYPATH))
|
|
|
|
make_bitmap_from_file('{}/assets/Barnkanalen.png'.format(path))
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"ch-svt1": {
|
|
|
|
"ch-svt1": {
|
|
|
|
"name": "SVT 1",
|
|
|
|
"name": "SVT 1",
|
|
|
|
"thumbnail":
|
|
|
|
"thumbnail":
|
|
|
|
make_bitmap_from_file('{}/assets/SVT1.png'.format(MYPATH))
|
|
|
|
make_bitmap_from_file('{}/assets/SVT1.png'.format(path))
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"ch-svt2": {
|
|
|
|
"ch-svt2": {
|
|
|
|
"name": "SVT 2",
|
|
|
|
"name": "SVT 2",
|
|
|
|
"thumbnail":
|
|
|
|
"thumbnail":
|
|
|
|
make_bitmap_from_file('{}/assets/SVT2.png'.format(MYPATH))
|
|
|
|
make_bitmap_from_file('{}/assets/SVT2.png'.format(path))
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"ch-svt24": {
|
|
|
|
"ch-svt24": {
|
|
|
|
"name":
|
|
|
|
"name":
|
|
|
|
"SVT 24",
|
|
|
|
"SVT 24",
|
|
|
|
"thumbnail":
|
|
|
|
"thumbnail":
|
|
|
|
make_bitmap_from_file('{}/assets/SVT24.png'.format(MYPATH))
|
|
|
|
make_bitmap_from_file('{}/assets/SVT24.png'.format(path))
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"ch-kunskapskanalen": {
|
|
|
|
"ch-kunskapskanalen": {
|
|
|
|
"name":
|
|
|
|
"name":
|
|
|
|
"Kunskapskanalen",
|
|
|
|
"Kunskapskanalen",
|
|
|
|
"thumbnail":
|
|
|
|
"thumbnail":
|
|
|
|
make_bitmap_from_file(
|
|
|
|
make_bitmap_from_file(
|
|
|
|
'{}/assets/Kunskapskanalen.png'.format(MYPATH))
|
|
|
|
'{}/assets/Kunskapskanalen.png'.format(path))
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"feed": {
|
|
|
|
"feed": {
|
|
|
|
"name": "Senaste program",
|
|
|
|
"name": "Senaste program",
|
|
|
|
"thumbnail":
|
|
|
|
"thumbnail":
|
|
|
|
make_bitmap_from_file('{}/assets/SVT.png'.format(MYPATH))
|
|
|
|
make_bitmap_from_file('{}/assets/SVT.png'.format(path))
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|