Skip to content

Conversation

@darrell-k
Copy link
Contributor

No description provided.

@michaelherger
Copy link
Member

What is this change supposed to do exactly?

@darrell-k
Copy link
Contributor Author

It passes through the tags parameter from the UI SlimBrowse command (if present) to the handler. Sorry, I could have been more descriptive above.

@michaelherger
Copy link
Member

Oh, is this needed because the handler wouldn't get a reference to the request object?

@darrell-k
Copy link
Contributor Author

Correct. From XMLBrowser:

$subFeed->{url}->( $client, $callback, \%args, @{$pt});

(confusingly mapped to $client, $cb, $params, $args in the Qobuz plugin.)

So I've added tags to %args in XMLBrowser, as that's where the other SlimBrowse command parameters are passed.

Copy link
Member

@michaelherger michaelherger left a comment

Choose a reason for hiding this comment

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

Hmm... I'm wondering why none of the other params would be added the same way. Are they included automatically? Are they not forwarded to the handler?

I'm sorry if I'm missing the obvious. I'm away from a "real" computer, haven't set up my tablet for good reviews.

@darrell-k
Copy link
Contributor Author

They are added explicitly in the existing code, immediately below where I added tags:

my %args = (params => $feed->{'query'}, isControl => 1);
if (defined $search && $subFeed->{type} && ($subFeed->{type} eq 'search' || defined $subFeed->{'searchParam'})) {
$args{'search'} = $search;
}
# If we are getting an intermediate level, then we just need the one item
# If we are getting the last level then we need all items if we are doing playall of some kind
if (defined $index && $quantity && $depth == $levels && !$isPlaylistCmd) {
if ($feedMode) {
$args{'index'} = $index;
$args{'quantity'} = $quantity;
} else {
# hack to allow for some CM entries
my $j = 10;
$j = $index if ($j > $index);
$args{'index'} = $index - $j;
$args{'quantity'} = $quantity + $j;
}
} elsif ($depth < $levels) {
$args{'index'} = $index[$depth];
$args{'quantity'} = 1;
}

@michaelherger
Copy link
Member

That code has always been... challenging. There's $args->{something}, and there's $args{somethings}. Not the same... one is a hash ref, the other a hash, and the ref is not pointing at the hash of the almost identical name. Argh... 🤦🏻 Thanks!

@michaelherger michaelherger merged commit 65ced03 into LMS-Community:SlimBrowse-Metadata Jun 21, 2025
1 check passed
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.

2 participants