Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relaxing channel name check in Xtream API #178

Merged
merged 27 commits into from
Dec 8, 2021
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
293963b
Added Initial XTream
superolmo May 28, 2021
a1dca48
Added XTream Series
superolmo Jun 2, 2021
d0be0a5
Added check for local logo_path
superolmo Jun 4, 2021
a84f7ce
Back to fixed path
superolmo Jun 4, 2021
b97598a
Added pyxtream choice
superolmo Jun 5, 2021
0530fc9
Replaced the test server
superolmo Jun 6, 2021
b56a6fb
Replaced the test server
superolmo Jun 6, 2021
ab11dfd
Fixed cache-path and added regex search
superolmo Jun 7, 2021
5d4a971
Merge branch 'master' of github.com:superolmo/hypnotix
superolmo Jun 7, 2021
2b8d127
Merge branch 'master' of https://github.com/linuxmint/hypnotix into l…
superolmo Jun 7, 2021
b38d61e
Changed osp back to os.path
superolmo Jun 7, 2021
7db1d62
Changed osp back to os.path
superolmo Jun 7, 2021
06517d6
Merge branch 'linuxmin-master'
superolmo Jun 7, 2021
2a45eb1
Fixed bug in the way it reload from cache
superolmo Jun 12, 2021
e79a848
Fixed missing provider when it doesn't load
superolmo Jun 18, 2021
dcbb6a1
Improved handling of missing keys
superolmo Jun 18, 2021
97b9e73
Fixed Categories and cleaned up the code
superolmo Jun 18, 2021
32af21f
Updated function names to follow PEP8
superolmo Jun 28, 2021
51e6d1d
Added check before authorizing
superolmo Sep 27, 2021
e6390d9
Merge remote-tracking branch 'upstream/master'
superolmo Sep 27, 2021
fca44f2
Scale down changes
superolmo Sep 27, 2021
0b41feb
Revert some more changes
superolmo Sep 27, 2021
215e191
Revert last changes
superolmo Sep 27, 2021
76bd0f2
Revert flag name
superolmo Sep 27, 2021
211db79
Discard streams w/o name, change live radio type to live stream
superolmo Nov 5, 2021
c8577a2
Rebase to upstream master
superolmo Nov 28, 2021
a7d447c
Fix subgroup name check
superolmo Dec 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Scale down changes
  • Loading branch information
superolmo committed Sep 27, 2021
commit fca44f2477dbb99992e01b10e5c04d5933b1f017
48 changes: 9 additions & 39 deletions usr/lib/hypnotix/hypnotix.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@
gettext.textdomain(APP)
_ = gettext.gettext

HYPNOTIX_HOME_PATH= os.path.abspath(
os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"../../../"
)
)

PROVIDER_OBJ, PROVIDER_NAME = range(2)
PROVIDER_TYPE_ID, PROVIDER_TYPE_NAME = range(2)

Expand Down Expand Up @@ -116,7 +109,7 @@ def __init__(self, application):
# Used for redownloading timer
self.reload_timeout_sec = 60*5
self._timerid = -1
gladefile = os.path.join(HYPNOTIX_HOME_PATH,"usr/share/hypnotix/hypnotix.ui")
gladefile = "usr/share/hypnotix/hypnotix.ui"
self.builder = Gtk.Builder()
self.builder.set_translation_domain(APP)
self.builder.add_from_file(gladefile)
Expand All @@ -128,7 +121,7 @@ def __init__(self, application):
self.info_window = self.builder.get_object("stream_info_window")

provider = Gtk.CssProvider()
provider.load_from_path(os.path.join(HYPNOTIX_HOME_PATH,"usr/share/hypnotix/hypnotix.css"))
provider.load_from_path("usr/share/hypnotix/hypnotix.css")

screen = Gdk.Display.get_default_screen(Gdk.Display.get_default())
# I was unable to found instrospected version of this
Expand Down Expand Up @@ -285,24 +278,9 @@ def __init__(self, application):
self.provider_type_combo.set_active(0) # Select 1st type
self.provider_type_combo.connect("changed", self.on_provider_type_combo_changed)

self.tv_logo.set_from_pixbuf(GdkPixbuf.Pixbuf.new_from_file_at_size(
os.path.join(HYPNOTIX_HOME_PATH,"usr/share/hypnotix/pictures/tv.svg"),
258,
258
)
)
self.movies_logo.set_from_pixbuf(GdkPixbuf.Pixbuf.new_from_file_at_size(
os.path.join(HYPNOTIX_HOME_PATH,"usr/share/hypnotix/pictures/movies.svg"),
258,
258
)
)
self.series_logo.set_from_pixbuf(GdkPixbuf.Pixbuf.new_from_file_at_size(
os.path.join(HYPNOTIX_HOME_PATH,"usr/share/hypnotix/pictures/series.svg"),
258,
258
)
)
self.tv_logo.set_from_pixbuf(GdkPixbuf.Pixbuf.new_from_file_at_size("usr/share/hypnotix/pictures/tv.svg",258,258))
self.movies_logo.set_from_pixbuf(GdkPixbuf.Pixbuf.new_from_file_at_size("usr/share/hypnotix/pictures/movies.svg",258,258))
self.series_logo.set_from_pixbuf(GdkPixbuf.Pixbuf.new_from_file_at_size("usr/share/hypnotix/pictures/series.svg",258,258))

self.reload(page="landing_page")

Expand All @@ -320,7 +298,7 @@ def __init__(self, application):
def add_badge(self, word, box, added_words):
if word not in added_words:
for extension in ["svg", "png"]:
badge = os.path.join(HYPNOTIX_HOME_PATH,"usr/share/hypnotix/pictures/badges/%s.%s" % (word, extension))
badge = "usr/share/hypnotix/pictures/badges/%s.%s" % (word, extension)
if os.path.exists(badge):
try:
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(badge, -1, 16)
Expand Down Expand Up @@ -679,7 +657,7 @@ def navigate_to(self, page, name="", search=False):
self.headerbar.set_subtitle(_("Search > %s" % self.search_bar.get_text().strip()))

def open_keyboard_shortcuts(self, widget):
gladefile = os.path.join(HYPNOTIX_HOME_PATH,"usr/share/hypnotix/shortcuts.ui")
gladefile = "usr/share/hypnotix/shortcuts.ui"
builder = Gtk.Builder()
builder.set_translation_domain(APP)
builder.add_from_file(gladefile)
Expand Down Expand Up @@ -1204,10 +1182,7 @@ def open_about(self, widget):
dlg.set_program_name(_("Hypnotix"))
dlg.set_comments(_("Watch TV"))
try:
h = open(
os.path.join(HYPNOTIX_HOME_PATH,'usr/share/common-licenses/GPL'),
encoding="utf-8"
)
h = open('usr/share/common-licenses/GPL'),encoding="utf-8")
s = h.readlines()
gpl = ""
for line in s:
Expand Down Expand Up @@ -1307,12 +1282,7 @@ def reload(self, page=None, refresh=False):

else:
# Load xtream class
try:
# Try loading from pyxtream PYPI module
from pyxtream import XTream
except ModuleNotFoundError:
# If there was an error, load local copy
from xtream import XTream
from xtream import XTream
# Download via Xtream
self.x = XTream(provider.name,provider.username,provider.password,provider.url,os.path.expanduser("~/.hypnotix/providers"))
if self.x.auth_data != {}:
Expand Down