2#include <QReadWriteLock>
11#define LOC QString("VideoMetaDataUtil: ")
21 QString basename = pathname.section(
'/', -1);
23 if (basename == pathname)
25 LOG(VB_GENERAL, LOG_WARNING,
LOC +
26 "Programmer Error: Cannot determine art path\n\t\t\t"
27 "until the ProgramInfo pathname has been fully resolved.");
35 for (
const auto & [arttype, artpath] : std::as_const(ret))
41 QString fn = basename;
45 if (
type ==
"Coverart")
46 dbcolumn =
"coverfile";
47 else if (
type ==
"Fanart")
49 else if (
type ==
"Banners")
51 else if (
type ==
"Screenshots")
52 dbcolumn =
"screenshot";
54 QString querystr = QString(
"SELECT %1 "
55 "FROM videometadata WHERE filename "
56 "LIKE :FILENAME").arg(dbcolumn);
64 artpath = query.
value(0).toString();
66 if (!artpath.startsWith(
'/') && pathname.startsWith(
"myth://"))
68 const QString& workURL = pathname;
69 QUrl baseURL(workURL);
70 baseURL.setUserName(
type);
72 baseURL.toString(QUrl::RemovePath) +
'/' + artpath;
QSqlQuery wrapper that fetches a DB connection from the connection pool.
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
QVariant value(int i) const
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)