Skip to content
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
6 changes: 6 additions & 0 deletions Slim/Buttons/XMLBrowser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,9 @@ sub gotOPML {
);

}
elsif ( $item->{'type'} && $item->{'type'} eq 'header' ) {
$client->bumpRight();
}
elsif ( Slim::Control::XMLBrowser::hasDescription($item) ) {

displayItemDescription($client, $item, $opml);
Expand Down Expand Up @@ -977,6 +980,9 @@ sub overlaySymbol {
elsif ( Slim::Control::XMLBrowser::hasAudio($item) ) {
$overlay = $client->symbols('notesymbol');
}
elsif ( $item->{type} && $item->{type} eq 'header' ) {
$overlay = $client->symbols('rightarrow') if exists $item->{items};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would a header have items? I guess that's the same comment as before: you said a header would never have items. Why keep the option to show the arrow in that not to be expected situation?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A header can contain items or an URL (function pointer) or neither.

}
elsif ( !$item->{type} || $item->{type} ne 'text' ) {
$overlay = $client->symbols('rightarrow');
}
Expand Down
2 changes: 1 addition & 1 deletion Slim/Control/XMLBrowser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ sub _cliQuery_done {
$hasImage = 1;
}

if ( $item->{type} && $item->{type} eq 'text' && !$item->{wrap} && !$item->{jive} ) {
if ( $item->{type} && ( ($item->{type} eq 'text' && !$item->{wrap} && !$item->{jive}) || ($item->{type} eq 'header' && !$item->{items} && !$item->{url}) ) ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under what circumstances would a header item have items and a URL?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not aware of any. I suspect you overlooked the ‘!’.
The condition ‘no action’ for ‘header’ is true if there are no items and no url.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the exclusion is why I'm asking: why add that condition if it is expected to always be true? Seems to be just noise, rendering the condition difficult to read?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A header can contain items or an URL (function pointer) or neither.

$hash{'style'} ||= 'itemNoAction';
$hash{'action'} = 'none';
}
Expand Down