Go to the documentation of this file. 1 #include <QReadWriteLock>
10 #define LOC QString("VideoMetaDataUtil: ")
13 using ArtPair = QPair< QString, QString >;
20 QString basename = pathname.section(
'/', -1);
22 if (basename == pathname)
24 LOG(VB_GENERAL, LOG_WARNING,
LOC +
25 "Programmer Error: Cannot determine art path\n\t\t\t"
26 "until the ProgramInfo pathname has been fully resolved.");
34 for (
const auto & [arttype, artpath] : std::as_const(ret))
40 QString fn = basename;
44 if (
type ==
"Coverart")
45 dbcolumn =
"coverfile";
46 else if (
type ==
"Fanart")
48 else if (
type ==
"Banners")
50 else if (
type ==
"Screenshots")
51 dbcolumn =
"screenshot";
53 QString querystr = QString(
"SELECT %1 "
54 "FROM videometadata WHERE filename "
55 "LIKE :FILENAME").arg(dbcolumn);
63 artpath = query.
value(0).toString();
65 if (!artpath.startsWith(
'/') && pathname.startsWith(
"myth://"))
67 const QString& workURL = pathname;
68 QUrl baseURL(workURL);
69 baseURL.setUserName(
type);
71 baseURL.toString(QUrl::RemovePath) +
'/' + artpath;
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
QSqlQuery wrapper that fetches a DB connection from the connection pool.
QVariant value(int i) const
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.