53 if ((pProgram ==
nullptr) || (pInfo ==
nullptr))
58 pProgram->setTitle ( pInfo->
GetTitle() );
62 pProgram->setRepeat ( pInfo->
IsRepeat() );
70 pProgram->setSerializeDetails( bDetails );
76 pProgram->setStars ( pInfo->
GetStars() );
94 pProgram->setAirdate( year );
99 pProgram->setSeason ( pInfo->
GetSeason() );
104 pProgram->setSerializeCast(bIncCast);
110 pProgram->setSerializeChannel( bIncChannel );
128 pProgram->setSerializeRecording(
true );
140 pRecording->setSerializeDetails( bDetails );
144 pRecording->setFileName ( pRecInfo.
GetPathname() );
145 pRecording->setFileSize ( pRecInfo.
GetFilesize() );
146 pRecording->setHostName ( pRecInfo.
GetHostname() );
156 pRecording->setEncoderId ( pRecInfo.
GetInputID() );
164 pProgram->setSerializeArtwork(
true );
180 if (channel.
Load(nChanID))
199 pChannel->setChanId(channelInfo.
m_chanId);
200 pChannel->setChanNum(channelInfo.
m_chanNum);
201 pChannel->setCallSign(channelInfo.
m_callSign);
202 if (!channelInfo.
m_icon.isEmpty())
204 QString sIconURL = QString(
"/Guide/GetChannelIcon?ChanId=%3")
206 pChannel->setIconURL( sIconURL );
208 pChannel->setChannelName(channelInfo.
m_name);
210 #ifndef _WIN32 // Needs fixing for Windows
214 pChannel->setSerializeDetails( bDetails );
218 pChannel->setMplexId(channelInfo.
m_mplexId);
223 pChannel->setFineTune(channelInfo.
m_fineTune);
224 pChannel->setFrequencyId(channelInfo.
m_freqId);
226 pChannel->setSourceId(channelInfo.
m_sourceId);
229 pChannel->setXMLTVID(channelInfo.
m_xmltvId);
235 for (
int x = 0; x < groupIds.size(); x++)
240 sGroupIds += QString::number(groupIds.at(x));
242 pChannel->setChannelGroups(sGroupIds);
246 for (
int x = 0; x < inputIds.size(); x++)
251 sInputIds += QString::number(inputIds.at(x));
253 pChannel->setInputs(sInputIds);
268 pGroup->setGroupId(pGroupItem.
m_grpId);
269 pGroup->setName(pGroupItem.
m_name);
270 pGroup->setPassword(
"");
280 if ((pRecRule ==
nullptr) || (pRule ==
nullptr))
286 pRecRule->setTitle ( pRule->
m_title );
289 pRecRule->setSeason ( pRule->
m_season );
290 pRecRule->setEpisode ( pRule->
m_episode );
292 pRecRule->setStartTime ( QDateTime(pRule->
m_startdate,
294 pRecRule->setEndTime ( QDateTime(pRule->
m_enddate,
298 pRecRule->setInetref ( pRule->
m_inetref );
300 pRecRule->setCallSign ( pRule->
m_station );
301 pRecRule->setFindDay ( pRule->
m_findday );
306 pRecRule->setPreferredInput ( pRule->
m_prefInput );
312 pRecRule->setFilter ( pRule->
m_filter );
339 const QString &sInetref,
343 for (
auto i = map.cbegin(); i != map.cend(); ++i)
346 pArtInfo->setFileName(i.value().url);
350 pArtInfo->setStorageGroup(
"Fanart");
351 pArtInfo->setType(
"fanart");
352 pArtInfo->setURL(QString(
"/Content/GetImageFile?StorageGroup=%1"
355 QString(QUrl::toPercentEncoding(
356 QUrl(i.value().url).path()))));
359 pArtInfo->setStorageGroup(
"Banners");
360 pArtInfo->setType(
"banner");
361 pArtInfo->setURL(QString(
"/Content/GetImageFile?StorageGroup=%1"
364 QString(QUrl::toPercentEncoding(
365 QUrl(i.value().url).path()))));
369 pArtInfo->setStorageGroup(
"Coverart");
370 pArtInfo->setType(
"coverart");
371 pArtInfo->setURL(QString(
"/Content/GetImageFile?StorageGroup=%1"
374 QString(QUrl::toPercentEncoding(
375 QUrl(i.value().url).path()))));
391 query.
prepare(
"SELECT genre from videogenre "
392 "LEFT JOIN videometadatagenre ON videometadatagenre.idgenre = videogenre.intid "
393 "WHERE idvideo = :ID "
397 if (query.
exec() && query.
size() > 0)
402 QString genre = query.
value(0).toString();
403 pGenre->setName(genre);
417 pVideoMetadataInfo->setId(pMetadata->GetID());
418 pVideoMetadataInfo->setTitle(pMetadata->GetTitle());
419 pVideoMetadataInfo->setSubTitle(pMetadata->GetSubtitle());
420 pVideoMetadataInfo->setTagline(pMetadata->GetTagline());
421 pVideoMetadataInfo->setDirector(pMetadata->GetDirector());
422 pVideoMetadataInfo->setStudio(pMetadata->GetStudio());
423 pVideoMetadataInfo->setDescription(pMetadata->GetPlot());
424 pVideoMetadataInfo->setCertification(pMetadata->GetRating());
425 pVideoMetadataInfo->setInetref(pMetadata->GetInetRef());
426 pVideoMetadataInfo->setCollectionref(pMetadata->GetCollectionRef());
427 pVideoMetadataInfo->setHomePage(pMetadata->GetHomepage());
428 pVideoMetadataInfo->setReleaseDate(
429 QDateTime(pMetadata->GetReleaseDate(),
430 QTime(0,0),Qt::LocalTime).toUTC());
431 pVideoMetadataInfo->setAddDate(
432 QDateTime(pMetadata->GetInsertdate(),
433 QTime(0,0),Qt::LocalTime).toUTC());
434 pVideoMetadataInfo->setUserRating(pMetadata->GetUserRating());
435 pVideoMetadataInfo->setChildID(pMetadata->GetChildID());
436 pVideoMetadataInfo->setLength(pMetadata->GetLength().count());
437 pVideoMetadataInfo->setPlayCount(pMetadata->GetPlayCount());
438 pVideoMetadataInfo->setSeason(pMetadata->GetSeason());
439 pVideoMetadataInfo->setEpisode(pMetadata->GetEpisode());
440 pVideoMetadataInfo->setParentalLevel(pMetadata->GetShowLevel());
441 pVideoMetadataInfo->setVisible(pMetadata->GetBrowse());
442 pVideoMetadataInfo->setWatched(pMetadata->GetWatched());
443 pVideoMetadataInfo->setProcessed(pMetadata->GetProcessed());
445 pMetadata->GetContentType()));
446 pVideoMetadataInfo->setFileName(pMetadata->GetFilename());
447 pVideoMetadataInfo->setHash(pMetadata->GetHash());
448 pVideoMetadataInfo->setHostName(pMetadata->GetHost());
449 pVideoMetadataInfo->setCoverart(pMetadata->GetCoverFile());
450 pVideoMetadataInfo->setFanart(pMetadata->GetFanart());
451 pVideoMetadataInfo->setBanner(pMetadata->GetBanner());
452 pVideoMetadataInfo->setScreenshot(pMetadata->GetScreenshot());
453 pVideoMetadataInfo->setTrailer(pMetadata->GetTrailer());
454 pVideoMetadataInfo->setSerializeArtwork(
true );
458 if (!pMetadata->GetFanart().isEmpty())
461 pVideoMetadataInfo->
Artwork()->AddNewArtworkInfo();
462 pArtInfo->setStorageGroup(
"Fanart");
463 pArtInfo->setType(
"fanart");
464 pArtInfo->setURL(QString(
"/Content/GetImageFile?StorageGroup=%1"
468 QUrl::toPercentEncoding(pMetadata->GetFanart()))));
470 if (!pMetadata->GetCoverFile().isEmpty())
473 pVideoMetadataInfo->
Artwork()->AddNewArtworkInfo();
474 pArtInfo->setStorageGroup(
"Coverart");
475 pArtInfo->setType(
"coverart");
476 pArtInfo->setURL(QString(
"/Content/GetImageFile?StorageGroup=%1"
480 QUrl::toPercentEncoding(pMetadata->GetCoverFile()))));
482 if (!pMetadata->GetBanner().isEmpty())
485 pVideoMetadataInfo->
Artwork()->AddNewArtworkInfo();
486 pArtInfo->setStorageGroup(
"Banners");
487 pArtInfo->setType(
"banner");
488 pArtInfo->setURL(QString(
"/Content/GetImageFile?StorageGroup=%1"
492 QUrl::toPercentEncoding(pMetadata->GetBanner()))));
494 if (!pMetadata->GetScreenshot().isEmpty())
497 pVideoMetadataInfo->
Artwork()->AddNewArtworkInfo();
498 pArtInfo->setStorageGroup(
"Screenshots");
499 pArtInfo->setType(
"screenshot");
500 pArtInfo->setURL(QString(
"/Content/GetImageFile?StorageGroup=%1"
504 QUrl::toPercentEncoding(pMetadata->GetScreenshot()))));
518 pVideoMetadataInfo->setId(pMetadata->
ID());
519 pVideoMetadataInfo->setArtist(pMetadata->
Artist());
521 pVideoMetadataInfo->setAlbum(pMetadata->
Album());
522 pVideoMetadataInfo->setTitle(pMetadata->
Title());
523 pVideoMetadataInfo->setTrackNo(pMetadata->
Track());
524 pVideoMetadataInfo->setGenre(pMetadata->
Genre());
525 pVideoMetadataInfo->setYear(pMetadata->
Year());
526 pVideoMetadataInfo->setPlayCount(pMetadata->
PlayCount());
527 pVideoMetadataInfo->setLength(pMetadata->
Length().count());
528 pVideoMetadataInfo->setRating(pMetadata->
Rating());
529 pVideoMetadataInfo->setFileName(pMetadata->
Filename());
530 pVideoMetadataInfo->setHostName(pMetadata->
Hostname());
531 pVideoMetadataInfo->setLastPlayed(pMetadata->
LastPlay());
532 pVideoMetadataInfo->setCompilation(pMetadata->
Compilation());
547 input->setInputName(inputInfo.
m_name);
564 if (!pCastMemberList || !pInfo)
571 table =
"recordedcredits";
575 query.
prepare(QString(
"SELECT role, people.name, roles.name FROM %1"
577 " LEFT JOIN people ON"
578 " credits.person = people.person"
579 " LEFT JOIN roles ON"
580 " credits.roleid = roles.roleid"
581 " WHERE credits.chanid = :CHANID"
582 " AND credits.starttime = :STARTTIME"
583 " ORDER BY role, priority;").arg(table));
588 if (query.
exec() && query.
size() > 0)
590 QMap<QString, QString> translations;
591 translations[
"ACTOR"] = QObject::tr(
"Actors");
592 translations[
"DIRECTOR"] = QObject::tr(
"Director");
593 translations[
"PRODUCER"] = QObject::tr(
"Producer");
594 translations[
"EXECUTIVE_PRODUCER"] = QObject::tr(
"Executive Producer");
595 translations[
"WRITER"] = QObject::tr(
"Writer");
596 translations[
"GUEST_STAR"] = QObject::tr(
"Guest Star");
597 translations[
"HOST"] = QObject::tr(
"Host");
598 translations[
"ADAPTER"] = QObject::tr(
"Adapter");
599 translations[
"PRESENTER"] = QObject::tr(
"Presenter");
600 translations[
"COMMENTATOR"] = QObject::tr(
"Commentator");
601 translations[
"GUEST"] = QObject::tr(
"Guest");
607 QString role = query.
value(0).toString();
608 pCastMember->setRole(role);
609 pCastMember->setTranslatedRole(translations.value(role.toUpper()));
625 pCastMember->setName(QString::fromUtf8(query.
value(1)
626 .toByteArray().constData()));
627 pCastMember->setCharacterName(QString::fromUtf8(query.
value(2)
628 .toByteArray().constData()));
643 frm_dir_map_t::const_iterator it;
649 for (it = markMap.cbegin(); it != markMap.cend(); ++it)
655 pCutting->setMark(*it);
656 pCutting->setOffset(it.key());
658 else if (marktype == 1)
664 pCutting->setMark(*it);
665 pCutting->setOffset(offset);
668 else if (marktype == 2)
674 pCutting->setMark(*it);
675 pCutting->setOffset(offset);
689 frm_dir_map_t::const_iterator it;
695 for (it = markMap.cbegin(); it != markMap.cend(); ++it)
701 pCutting->setMark(*it);
702 pCutting->setOffset(it.key());
704 else if (marktype == 1)
710 pCutting->setMark(*it);
711 pCutting->setOffset(offset);
714 else if (marktype == 2)
720 pCutting->setMark(*it);
721 pCutting->setOffset(offset);
735 frm_pos_map_t::const_iterator it;
741 for (it = markMap.cbegin(); it != markMap.cend(); ++it)
744 pCutting->setMark(it.key());
745 pCutting->setOffset(it.value());
755 query.
prepare(
"INSERT INTO recgroups SET recgroup = :NAME, "
756 "displayname = :DISPLAYNAME");
758 query.
bindValue(
":DISPLAYNAME", groupName);
764 LOG(VB_GENERAL, LOG_ERR, QString(
"Could not create recording group (%1). "
765 "Does it already exist?").arg(groupName));
775 QJsonArray members = cast[
"CastMembers"].toArray();
776 for (
const auto & m : members)
778 QJsonObject actor = m.toObject();
779 QString name = actor.value(
"Name").toString(
"");
780 QString character = actor.value(
"CharacterName").toString(
"");
781 QString role = actor.value(
"Role").toString(
"");
783 credits->push_back(
DBPerson(role, name, priority, character));