1332 | | pRequest->m_sFileName = QString( "%1/%2" ) |
1333 | | .arg( sBasePath ) |
1334 | | .arg( query.value(0).toString() ); |
1335 | | } |
| 1332 | filename = query.value(0).toString() ; |
| 1333 | } } |
| 1334 | |
| 1335 | // ------------------------------------------------------------------ |
| 1336 | // Check for diff format required if not |
| 1337 | // ------------------------------------------------------------------ |
| 1338 | QString peerIP = pRequest->GetPeerAddress(); |
| 1339 | QString altHosts = gContext->GetSetting("UpnpAltMusicHosts", ""); |
| 1340 | bool isAltHost = altHosts.contains(peerIP) > 0; |
| 1341 | QString regExtension = gContext->GetSetting("UpnpNormalMusicExtension", |
| 1342 | "none"); |
| 1343 | VERBOSE(VB_UPNP,QString("HttpStatus::GetMusic : peerIP %1, altHosts" |
| 1344 | " %2, regExtension %3").arg(peerIP).arg(altHosts).arg(regExtension)); |
| 1345 | if(isAltHost && filename.endsWith(QString(".%1").arg(regExtension))) { |
| 1346 | sBasePath = gContext->GetSetting("UpnpAltMusicLocation", sBasePath); |
| 1347 | int index = filename.length() -5; |
| 1348 | QString it = filename.replace(index, 4, QString(".mp3")); |
| 1349 | it = it.left(filename.length() -1); |
| 1350 | VERBOSE(VB_UPNP,QString("HttpStatus::GetMusic : m_sFileName ends" |
| 1351 | " in .flac, replace with %1").arg(it)); |
| 1352 | filename = it; |
| 1353 | |