diff --git a/Slim/Plugin/InternetRadio/TuneIn.pm b/Slim/Plugin/InternetRadio/TuneIn.pm index 82b1ba8aa24..232b285a9f4 100644 --- a/Slim/Plugin/InternetRadio/TuneIn.pm +++ b/Slim/Plugin/InternetRadio/TuneIn.pm @@ -13,6 +13,12 @@ package Slim::Plugin::InternetRadio::TuneIn; use strict; +BEGIN { + use Exporter::Lite; + use constant PARTNER_ID => 15; + our @EXPORT_OK = qw(PARTNER_ID); +} + use Digest::MD5 (); use Tie::IxHash; use URI; @@ -74,8 +80,7 @@ use constant MENUS => { }, }; -use constant PARTNER_ID => 15; -use constant MAIN_URL => 'http://opml.radiotime.com/Index.aspx?partnerId=' . PARTNER_ID; +use constant MAIN_URL => 'http://opml.radiotime.com/Index.aspx?partnerId=16'; use constant ERROR_URL => 'http://opml.radiotime.com/Report.ashx?c=stream&partnerId=' . PARTNER_ID; use constant PRESETS_URL => 'http://opml.radiotime.com/Browse.ashx?c=presets&partnerId=' . PARTNER_ID; use constant OPTIONS_URL => 'http://opml.radiotime.com/Options.ashx?partnerId=' . PARTNER_ID . '&id='; @@ -135,6 +140,12 @@ sub parseMenu { $item->{icon} = MENUS->{$key}->{icon} || MENUS->{'default'}->{icon}; $item->{iconre} = 'radiotime'; $item->{weight} = $weight; + + while (my ($k, $v) = each %$item) { + $v =~ s/(partnerId=)16/$1${\PARTNER_ID}/ig; + $item->{$k} = $v; + } + push @$menu, $item; # TTP 864, Use the string token for name instead of whatever translated name we get @@ -208,6 +219,7 @@ sub fixUrl { $rtinfo->{serial} ||= $class->getSerial($client); $rtinfo->{partnerId} ||= PARTNER_ID; + $rtinfo->{partnerId} =~ s/(partnerId=)16\b/$1${\PARTNER_ID}/ig; $rtinfo->{username} ||= $class->getUsername if $feed =~ /presets/; $rtinfo->{formats} = join(',', @formats); $rtinfo->{id} = $rtinfo->{sid} || $rtinfo->{id}; diff --git a/Slim/Plugin/InternetRadio/TuneIn/Metadata.pm b/Slim/Plugin/InternetRadio/TuneIn/Metadata.pm index 314b51810a4..1ecb11823fa 100644 --- a/Slim/Plugin/InternetRadio/TuneIn/Metadata.pm +++ b/Slim/Plugin/InternetRadio/TuneIn/Metadata.pm @@ -12,7 +12,7 @@ use Slim::Formats::RemoteMetadata; use Slim::Formats::XML; use Slim::Music::Info; use Slim::Networking::SimpleAsyncHTTP; -use Slim::Plugin::InternetRadio::TuneIn; +use Slim::Plugin::InternetRadio::TuneIn qw(PARTNER_ID); use Slim::Utils::Cache; use Slim::Utils::Log; use Slim::Utils::Prefs; @@ -24,7 +24,6 @@ my $log = logger('plugin.radio'); my $prefs = preferences('plugin.radiotime'); my $cache = Slim::Utils::Cache->new(); -use constant PARTNER_ID => 16; use constant META_URL => 'http://opml.radiotime.com/NowPlaying.aspx?partnerId=' . PARTNER_ID; use constant CONFIG_URL => 'http://opml.radiotime.com/Config.ashx?c=api&partnerId=' . PARTNER_ID . '&serial='; use constant ICON => 'plugins/TuneIn/html/images/icon.png';