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

implementation of an orientation for bundles #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions ictv/models/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,14 @@ def flatten(self, keep_disabled_channels=False):
def get_type_name(self):
return 'Bundle'

def is_vertical_bundle(self):
vertical = False
for c in self.flatten(False):
if c.get_config_param('vertical'):
vertical = True
break
return vertical

def has_no_cycles(self, channels, marked=None):
if marked is None:
marked = set()
Expand Down
7 changes: 6 additions & 1 deletion ictv/pages/channel_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@ def render_page(self, channel):
if type(channel) is PluginChannel and last_update + timedelta(minutes=channel.cache_validity) < now:
last_update = now
try:
vertical = channel.get_config_param('vertical') if type(channel) is PluginChannel else False
if type(channel) is ChannelBundle:
vertical = channel.is_vertical_bundle()
elif type(channel) is PluginChannel:
vertical = channel.get_config_param('vertical')
else:
vertical = False
except KeyError:
vertical = False
return self.renderer.channeld(channel=channel, channel_type=type(channel).__name__, current_user=current_user,
Expand Down