[Slim-Checkins] r33978 - /7.7/trunk/server/Slim/Plugin/MOG/ProtocolHandler.pm
[email protected] Fri, 06 Jul 2012 08:05:33 -0000
| Newsgroups | gmane.music.equipment.slimdevices.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: fmueller
Date: Fri Jul 6 01:05:33 2012
New Revision: 33978
URL: http://svn.slimdevices.com/slim?rev=33978&view=rev
Log:
Bug: n/a
Description: Fix for '302 Moved Temporarily' redirect (MOG Australia).
Modified:
7.7/trunk/server/Slim/Plugin/MOG/ProtocolHandler.pm
Modified: 7.7/trunk/server/Slim/Plugin/MOG/ProtocolHandler.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Plugin/MOG/ProtocolHandler.pm?rev=33978&r1=33977&r2=33978&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Plugin/MOG/ProtocolHandler.pm (original)
+++ 7.7/trunk/server/Slim/Plugin/MOG/ProtocolHandler.pm Fri Jul 6 01:05:33 2012
@@ -99,11 +99,15 @@
my $length;
my $rangelength;
+ my $redir;
foreach my $header (@headers) {
if ( $header =~ /^Content-Length:\s*(.*)/i ) {
$length = $1;
}
+ elsif ($header =~ /^Location:\s*(.*)/i) {
+ $redir = $1;
+ }
elsif ( $header =~ m{^Content-Range: .+/(.*)}i ) {
$rangelength = $1;
last;
@@ -120,7 +124,7 @@
$song->duration($duration);
# ($title, $bitrate, $metaint, $redir, $contentType, $length, $body)
- return (undef, $bitrate, 0, '', 'mp3', $length, undef);
+ return (undef, $bitrate, 0, $redir, 'mp3', $length, undef);
}
# Don't allow looping