Beispiel #1
0
MetadataLookupList MetadataDownload::handleVideoUndetermined(
                                                    MetadataLookup* lookup)
{
    MetadataLookupList list;

    QString def_cmd = QDir::cleanPath(QString("%1/%2")
        .arg(GetShareDir())
        .arg("metadata/Television/ttvdb.py"));

    QString cmd = gCoreContext->GetSetting("TelevisionGrabber", def_cmd);

    // Can't trust the inetref with so little information.

    QStringList args;
    args.append(QString("-l")); // Language Flag
    args.append(gCoreContext->GetLanguage()); // UI Language
    args.append(QString("-N"));
    QString title = lookup->GetTitle();
    args.append(ShellEscape(title));
    QString subtitle = lookup->GetSubtitle();
    args.append(ShellEscape(subtitle));

    // Try to do a title/subtitle lookup
    list = runGrabber(cmd, args, lookup, false);

    // If there were no results for that, fall back to a movie lookup.
    if (!list.size())
        list = handleMovie(lookup);

    if (list.count() == 1)
        list.at(0)->SetStep(GETDATA);

    return list;
}
Beispiel #2
0
bool GLInjectInput::LaunchApplication(const QString& channel, bool relax_permissions, const QString& command, const QString& working_directory) {

	// prepare command
	QString full_command = "LD_PRELOAD=\"libssr-glinject.so\" ";
	full_command += "SSR_CHANNEL=\"" + ShellEscape(channel) + "\" ";
	if(relax_permissions)
		full_command += "SSR_STREAM_RELAX_PERMISSIONS=1 ";
	full_command += command;

	// execute it
	QStringList args;
	args.push_back("-c");
	args.push_back(full_command);
	return QProcess::startDetached("/bin/sh", args, working_directory);

}
Beispiel #3
0
MetadataLookupList MetadataDownload::handleTelevision(MetadataLookup* lookup)
{
    MetadataLookupList list;

    QString def_cmd = QDir::cleanPath(QString("%1/%2")
        .arg(GetShareDir())
        .arg("metadata/Television/ttvdb.py"));

    QString cmd = gCoreContext->GetSetting("TelevisionGrabber", def_cmd);

    QStringList args;
    args.append(QString("-l")); // Language Flag
    args.append(gCoreContext->GetLanguage()); // UI Language

    // If the inetref is populated, even in search mode,
    // become a getdata grab and use that.
    if (lookup->GetStep() == SEARCH &&
        (!lookup->GetInetref().isEmpty() &&
         lookup->GetInetref() != "00000000"))
        lookup->SetStep(GETDATA);

    if (lookup->GetStep() == SEARCH)
    {
        args.append(QString("-M"));
        QString title = lookup->GetTitle();
        args.append(ShellEscape(title));
    }
    else if (lookup->GetStep() == GETDATA)
    {
        args.append(QString("-D"));
        args.append(lookup->GetInetref());
        args.append(QString::number(lookup->GetSeason()));
        args.append(QString::number(lookup->GetEpisode()));
    }
    list = runGrabber(cmd, args, lookup);
    return list;
}