Skip to content

Commit

Permalink
Merge pull request #584 from philippe44/Inheritance-issue-on-Player-P…
Browse files Browse the repository at this point in the history
…rotocols

Consistency of Player::Protocols inheritance
  • Loading branch information
mherger authored Apr 13, 2021
2 parents be491b5 + a2847ca commit a0fdaba
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
10 changes: 7 additions & 3 deletions Slim/Formats/RemoteStream.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ sub isRemote {
return 1;
}

sub open {
sub new {
my $class = shift;
my $args = shift;

Expand Down Expand Up @@ -119,8 +119,12 @@ sub open {

${*$sock}{'song'} = $args->{'song'};

return $sock->request($args);
return $sock->open($args);

}

sub open {
shift->request(@_);
}

sub request {
Expand Down Expand Up @@ -197,7 +201,7 @@ sub request {
$redir = Slim::Utils::Misc::cloneProtocol($redir, $url);
main::INFOLOG && $log->info("Redirect to: $redir");

return $class->open({
return $class->new({
'url' => $redir,
'song' => $args->{'song'},
'infoUrl' => $self->infoUrl,
Expand Down
2 changes: 1 addition & 1 deletion Slim/Player/Protocols/HTTP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ sub new {
# return undef;
}

my $self = $class->open($args);
my $self = $class->SUPER::new($args);

if (defined($self)) {
${*$self}{'client'} = $args->{'client'};
Expand Down
5 changes: 0 additions & 5 deletions Slim/Player/Protocols/HTTPS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ my $log = logger('player.streaming.remote');
my $prefs = preferences('server');

sub new {
# make sure it's our open called, not system's one
return Slim::Player::Protocols::HTTPS::open(@_);
}

sub open {
my $class = shift;
my $args = shift;
my $url = $args->{'url'} || '';
Expand Down
2 changes: 1 addition & 1 deletion Slim/Player/Protocols/MMS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ sub new {
my $url = $args->{'url'};
my $client = $args->{'client'};

my $self = $class->open($args);
my $self = $class->SUPER::new($args);

if (defined($self)) {
${*$self}{'client'} = $args->{'client'};
Expand Down

0 comments on commit a0fdaba

Please sign in to comment.