diff --git a/mythtv/libs/libmythupnp/upnpcds.cpp b/mythtv/libs/libmythupnp/upnpcds.cpp
index cc86e75..213dd9b 100644
|
a
|
b
|
QString UPnpCDSExtension::CreateIDString(const QString &requestId,
|
| 1069 | 1069 | |
| 1070 | 1070 | // For metadata requests the request ID will be the ID of the result, so |
| 1071 | 1071 | // we don't need to do anything |
| 1072 | | if (currentName == name.toLower() && !currentValue.isEmpty() && |
| 1073 | | currentValue == value.toLower()) |
| | 1072 | if (currentName.toLower() == name.toLower() && !currentValue.isEmpty() && |
| | 1073 | currentValue.toLower() == value.toLower()) |
| 1074 | 1074 | return requestId; |
| 1075 | 1075 | else if (currentName == name.toLower() && currentValue.isEmpty()) |
| 1076 | 1076 | return QString("%1=%2").arg(requestId).arg(value); |
diff --git a/mythtv/libs/libmythupnp/upnpcdsobjects.cpp b/mythtv/libs/libmythupnp/upnpcdsobjects.cpp
index 11df343..4400f4d 100644
|
a
|
b
|
void CDSObject::toXml( QTextStream &os, FilterMap &filter,
|
| 305 | 305 | * See UPnP MediaServer, ContentDirectory Service Section 2.3.18, 2013 |
| 306 | 306 | */ |
| 307 | 307 | bool bFilter = true; |
| | 308 | QString sTitle = m_sTitle; |
| 308 | 309 | |
| 309 | 310 | if (filter.contains("*")) |
| 310 | 311 | bFilter = false; |
| … |
… |
void CDSObject::toXml( QTextStream &os, FilterMap &filter,
|
| 346 | 347 | << "\" >" << endl; |
| 347 | 348 | |
| 348 | 349 | sEndTag = "</item>"; |
| 349 | | |
| | 350 | |
| | 351 | // if this is a video item, we have filters, and no ProgramTitle filter is specified - ass the program title to sTitle |
| | 352 | if( bFilter && m_sClass == "object.item.videoItem" && !filter.contains("programTitle")) |
| | 353 | sTitle = m_sTitle + ":" + HTTPRequest::Encode(GetPropValue("programTitle")); |
| 350 | 354 | break; |
| 351 | 355 | } |
| 352 | 356 | default: break; |
| 353 | 357 | } |
| 354 | 358 | |
| 355 | | os << "<dc:title>" << m_sTitle << "</dc:title>" << endl; |
| | 359 | os << "<dc:title>" << sTitle << "</dc:title>" << endl; |
| 356 | 360 | os << "<upnp:class>" << m_sClass << "</upnp:class>" << endl; |
| 357 | 361 | |
| 358 | 362 | // ---------------------------------------------------------------------- |
diff --git a/mythtv/libs/libmythupnp/upnpdevice.cpp b/mythtv/libs/libmythupnp/upnpdevice.cpp
index bb23de4..c5ff2b0 100644
|
a
|
b
|
QString UPnpDeviceDesc::FormatValue(const NameValue& node)
|
| 543 | 543 | NameValues::iterator it; |
| 544 | 544 | for (it = node.pAttributes->begin(); it != node.pAttributes->end(); ++it) |
| 545 | 545 | { |
| 546 | | sAttributes += QString(" %1='%2'").arg((*it).sName).arg((*it).sValue); |
| | 546 | sAttributes += QString(" %1=\"%2\"").arg((*it).sName).arg((*it).sValue); |
| 547 | 547 | } |
| 548 | 548 | sStr = QString("<%1%2>%3</%1>\n").arg(node.sName).arg(sAttributes).arg(node.sValue); |
| 549 | 549 | |
diff --git a/mythtv/libs/libmythupnp/upnphelpers.cpp b/mythtv/libs/libmythupnp/upnphelpers.cpp
index 2865e15..3f8a4b9 100644
|
a
|
b
|
QString DLNAProfileName(const QString &mimeType, const QSize &resolution,
|
| 120 | 120 | // information in the database for each file and can determine this |
| 121 | 121 | // stuff 'properly' |
| 122 | 122 | QString sCountryCode = gCoreContext->GetLocale()->GetCountryCode(); |
| 123 | | bool isNorthAmerica = (sCountryCode == "us" || sCountryCode == "ca" || |
| | 123 | bool isNorthAmerica = (sCountryCode.toLower() == "us" || sCountryCode == "ca" || |
| 124 | 124 | sCountryCode == "mx"); // North America (NTSC/ATSC) |
| 125 | 125 | |
| 126 | 126 | if (container == "MPEG2-PS") |
| … |
… |
QString DLNAProfileName(const QString &mimeType, const QSize &resolution,
|
| 199 | 199 | } |
| 200 | 200 | else if (mimeType == "audio/mpeg") |
| 201 | 201 | { |
| 202 | | sProfileName = "MP3X"; |
| | 202 | sProfileName = "MP3"; |
| 203 | 203 | } |
| 204 | 204 | else if (mimeType == "audio/x-ms-wma") |
| 205 | 205 | { |
| … |
… |
QString DLNAFourthField(UPNPProtocol::TransferProtocol protocol,
|
| 261 | 261 | // |
| 262 | 262 | QString sProfileName = DLNAProfileName(mimeType, resolution, videoFrameRate, |
| 263 | 263 | container, videoCodec, audioCodec); |
| 264 | | if (!sProfileName.isEmpty()) |
| 265 | | sAdditionalInfoList << QString("DLNA.ORG_PN=%1").arg(sProfileName); |
| 266 | | |
| | 264 | //Do not output DLNA Profile name - possible to add a DB parameter to enable/disable? |
| | 265 | //if (!sProfileName.isEmpty()) |
| | 266 | // sAdditionalInfoList << QString("DLNA.ORG_PN=%1").arg(sProfileName); |
| 267 | 267 | // |
| 268 | 268 | // OP-Param (Operation Parameters) |
| 269 | 269 | // |
diff --git a/mythtv/programs/mythbackend/upnpcdstv.cpp b/mythtv/programs/mythbackend/upnpcdstv.cpp
index 3fbc3e2..3c808f8 100644
|
a
|
b
|
bool UPnpCDSTv::LoadTitles(const UPnpCDSRequest* pRequest,
|
| 563 | 563 | int nRecordingID = query.value(2).toInt(); |
| 564 | 564 | int nTitleCount = query.value(3).toInt(); |
| 565 | 565 | |
| 566 | | if (nTitleCount > 1) |
| | 566 | if (nTitleCount >= 1) |
| 567 | 567 | { |
| 568 | 568 | // TODO Album or plain old container? |
| 569 | 569 | CDSObject* pContainer = CDSObject::CreateAlbum( CreateIDString(sRequestId, "Title", sTitle), |
| … |
… |
bool UPnpCDSTv::LoadDates(const UPnpCDSRequest* pRequest,
|
| 624 | 624 | MSqlQuery query(MSqlQuery::InitCon(MSqlQuery::kDedicatedConnection)); |
| 625 | 625 | |
| 626 | 626 | QString sql = "SELECT SQL_CALC_FOUND_ROWS " |
| 627 | | "r.starttime, COUNT(r.recordedid) " |
| | 627 | "CONVERT_TZ(r.starttime, 'UTC', 'SYSTEM'), COUNT(r.recordedid) " |
| 628 | 628 | "FROM recorded r " |
| 629 | 629 | "LEFT JOIN recgroups g ON g.recgroup=r.recgroup " |
| 630 | 630 | "%1 " // WHERE clauses |