forked from squeezebox-googlemusic/squeezebox-googlemusic
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRadioProtocolHandler.pm
59 lines (38 loc) · 1.16 KB
/
RadioProtocolHandler.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package Plugins::GoogleMusic::RadioProtocolHandler;
# Inspired by the Triode's Spotify Plugin
use strict;
use warnings;
Slim::Player::ProtocolHandlers->registerHandler(googlemusicradio => __PACKAGE__);
sub overridePlayback {
my ( $class, $client, $url ) = @_;
if ($url =~ /^googlemusicradio:station:(.*)$/) {
$client->execute(["googlemusicradio", "station", $1]);
return 1;
} elsif ($url =~ /^googlemusicradio:artist:(.*)$/) {
$client->execute(["googlemusicradio", "artist", $1]);
return 1;
} elsif ($url =~ /^googlemusicradio:album:(.*)$/) {
$client->execute(["googlemusicradio", "album", $1]);
return 1;
} elsif ($url =~ /^googlemusicradio:track:(.*)$/) {
$client->execute(["googlemusicradio", "track", $1]);
return 1;
} elsif ($url =~ /^googlemusicradio:genre:(.*)$/) {
$client->execute(["googlemusicradio", "genre", $1]);
return 1;
}
return;
}
sub canDirectStream {
return 0;
}
sub isRemote {
return 0;
}
sub contentType {
return 'googlemusicradio';
}
sub getIcon {
return Plugins::GoogleMusic::Plugin->_pluginDataFor('icon');
}
1;