Skip to content

Fix AttributeError: 'Channel' object has no attribute 'info' (#326) - #412

Open
CoderBoxer wants to merge 1 commit into
linuxmint:masterfrom
CoderBoxer:fix/channel-info-attribute
Open

CoderBoxer wants to merge 1 commit into
linuxmint:masterfrom
CoderBoxer:fix/channel-info-attribute

Conversation

@CoderBoxer

Copy link
Copy Markdown

Overview

Fixes an AttributeError crash that occurs when attempting to play or favorite streams from Xtream providers.

Changes

  • Refactored the string construction inside both before_play and on_favorite_button_toggled.
  • Replaced direct .info access with getattr(channel, 'info', '') (or self.active_channel).
  • This defensively handles Xtream Channel objects that lack the .info property, preventing a hard crash while safely preserving the data and ::: string formatting for standard M3U channels that still rely on it.

Closes #326

@heebo1974

Copy link
Copy Markdown

I can confirm that this issue also affects Favorites with Xtream providers in Hypnotix 5.6-2.

When clicking the Favorites button, on_favorite_button_toggled() accesses self.active_channel.info, but the Xtream Channel class does not have an info attribute. After removing the early page_is_loading return, this results in:

AttributeError: 'Channel' object has no attribute 'info'

I tested a local fix that handles Xtream channels separately and stores them in the existing EXTINF-based Favorites format. With this change, the channel is saved to ~/.cache/hypnotix/favorites/list, appears in Favorites, and can be played normally.

So I can confirm that the issue addressed by this PR affects Xtream Favorites as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hypnotix 4.3 - Xtream API : AttributeError: 'Channel' object has no attribute 'info'

2 participants