Fix paths for assets
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 401 B After Width: | Height: | Size: 401 B |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 7 KiB After Width: | Height: | Size: 7 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
@ -12,7 +12,7 @@ from vlc import Instance
|
||||||
|
|
||||||
from Channel import SVT
|
from Channel import SVT
|
||||||
from ChannelProvider import ChannelProvider
|
from ChannelProvider import ChannelProvider
|
||||||
from Utils import MYPATH, make_bitmap_from_file, make_sized_button
|
from Utils import make_bitmap_from_file, make_sized_button
|
||||||
|
|
||||||
WIDTH = int(720 / 2)
|
WIDTH = int(720 / 2)
|
||||||
HEIGHT = int(1440 / 2)
|
HEIGHT = int(1440 / 2)
|
||||||
|
@ -34,6 +34,7 @@ class Cast(wx.Frame):
|
||||||
:param kw:
|
:param kw:
|
||||||
"""
|
"""
|
||||||
self.m_mode = 'normal'
|
self.m_mode = 'normal'
|
||||||
|
self.asset_path: str = '/usr/share/cast'
|
||||||
url = None
|
url = None
|
||||||
if "url" in kw:
|
if "url" in kw:
|
||||||
self.m_mode = 'single'
|
self.m_mode = 'single'
|
||||||
|
@ -116,7 +117,7 @@ class Cast(wx.Frame):
|
||||||
|
|
||||||
if not self.m_chromecast_thr.is_alive(
|
if not self.m_chromecast_thr.is_alive(
|
||||||
) and not self.m_selected_chromecast:
|
) and not self.m_selected_chromecast:
|
||||||
btm = make_bitmap_from_file('{}/assets/Cast.png'.format(MYPATH), wx.Size(24,24))
|
btm = make_bitmap_from_file('{}/assets/Cast.png'.format(self.asset_path), wx.Size(24,24))
|
||||||
cast_button = wx.BitmapButton(self.m_panel,
|
cast_button = wx.BitmapButton(self.m_panel,
|
||||||
-1,
|
-1,
|
||||||
bitmap=btm,
|
bitmap=btm,
|
||||||
|
|
2
setup.py
|
@ -8,7 +8,7 @@ setuptools.setup(
|
||||||
version="0.0.1",
|
version="0.0.1",
|
||||||
author="Micke Nordin",
|
author="Micke Nordin",
|
||||||
author_email="hej@mic.ke",
|
author_email="hej@mic.ke",
|
||||||
data_files = [('share/applications', ['data/org.smolnet.cast.desktop']),],
|
data_files = [('share/applications', ['data/org.smolnet.cast.desktop']),('share/cast/assets', ['data/assets/'])],
|
||||||
description="A Public Service video player.",
|
description="A Public Service video player.",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
|
|
@ -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))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
Depends3: python3-bs4, python3-wxgtk4.0, python3-feedparser, python3-vlc, python3-pychromecast
|
Depends3: python3-bs4, python3-wxgtk4.0, python3-wxgtk-media4.0, python3-feedparser, python3-vlc, python3-pychromecast
|
||||||
Debian-Version: 1
|
Debian-Version: 2
|
||||||
|
|