Exemplo n.º 1
0
bool ScanVideoDirectory(const QString &start_path, DirectoryHandler *handler,
        const FileAssociations::ext_ignore_list &ext_disposition,
        bool list_unknown_extensions)
{
    ext_lookup extlookup(ext_disposition, list_unknown_extensions);

    bool pathScanned = true;

    if (!start_path.startsWith("myth://"))
    {
        VERBOSE(VB_GENERAL, QString("MythVideo::ScanVideoDirectory Scanning (%1)").arg(start_path));

        if (!scan_dir(start_path, handler, extlookup))
        {
            VERBOSE(VB_GENERAL, QString("MythVideo::ScanVideoDirectory failed to scan %1").arg(start_path));
            pathScanned = false;
        }
    }
    else
    {
        VERBOSE(VB_GENERAL, QString("MythVideo::ScanVideoDirectory Scanning Group (%1)").arg(start_path));
        QUrl sgurl = start_path;
        QString host = sgurl.host();
        QString path = sgurl.path();

        if (!scan_sg_dir(path, host, path, handler, extlookup, (isHostMaster(host) && (gCoreContext->GetHostName() == host))))
        {
            VERBOSE(VB_GENERAL, QString("MythVideo::ScanVideoDirectory failed to scan %1 ").arg(host));
            pathScanned = false;
        }
    }

    return pathScanned;
}
Exemplo n.º 2
0
QString VideoMetadata::VideoFileHash(const QString &file_name,
                           const QString &host)
{
    if (!host.isEmpty() && !isHostMaster(host))
    {
        QString url = generate_file_url("Videos", host, file_name);
        return RemoteFile::GetFileHash(url);
    }
    else if (!host.isEmpty())
    {
        StorageGroup sgroup("Videos", host);
        QString fullname = sgroup.FindFile(file_name);
        return FileHash(fullname);
    }
    else
        return FileHash(file_name);
}