seriesmarker.gui.model.episode_node module

class EpisodeNode(episode, parent=None)[source]

Bases: seriesmarker.gui.model.tree_node.TreeNode

Provides data for display about an Episode.

__init__(episode, parent=None)[source]

Initializes the node.

Parameters:
  • episode (Episode) – The episode to be handled by the node.
  • parent (SeasonNode) – The season node the episode belongs to.
check(state, origin=None)[source]

Sets the checked state of the node.

The checked state indicates whether or not an episode has been watched. When the state is set, the tree of the node is traversed upwards to its root, and the cached count of watched episodes in its branch is updated accordingly.

Parameters:
  • state (bool) – The checked state to set.
  • origin – The node which initiated the check call. Used to determine when to traverse the tree upward.
Type:

TreeNode

Returns:

The node itself, wrapped in a tuple, if only an episode has been checked. If a series or season has been checked, a tuple of a number and a reference is returned. The number indicates whether the episode has been checked (=1), unchecked (-1), or hasn’t been altered (0). The reference points either to the episode itself, or is None, to indicate that no change has happened.

See also

TreeNode.check()

Overrides TreeNode.check()

checked()[source]

Gets the checked state of the node.

Returns:True if the episode is marked as watched, otherwise False.

Overrides TreeNode.checked()

decoration(index)[source]

Retuns a snapshot image of the episode the node is related to.

Parameters:index (QModelIndex) – The index of the node, whose decoration was requested.

Todo

Should return a pixmap of an episode snapshot image instead of a default icon. By solving the todo, this method becomes obsolet and needs to be deleted - use/override DecoratedNode.banner_url() instead.

Returns:The PySide.QtGui.QPixmap containing the episode snapshot.

Overrides DecoratedNode.decoration()

name()[source]

Returns a string representation of the node’s data.

Returns:The title of the episode related to the node.

Overrides TreeNode.name()