Go to the documentation of this file.
16 if (inetref.isEmpty())
21 QString querystring =
"SELECT host, coverart, fanart, banner "
22 "FROM recordedartwork WHERE inetref = :INETREF ";
25 querystring +=
"AND season = :SEASON;";
30 querystring +=
"ORDER BY season = :SEASON DESC, season DESC;";
34 querystring +=
"ORDER BY season DESC;";
41 if (strict || season > 0)
52 QString host = query.
value(0).toString();
53 QString coverart = query.
value(1).toString();
54 QString fanart = query.
value(2).toString();
55 QString banner = query.
value(3).toString();
57 if (!coverart.isEmpty())
64 if (!fanart.isEmpty())
71 if (!banner.isEmpty())
85 const QString &coverart,
86 const QString &fanart,
87 const QString &banner)
92 if (!coverart.isEmpty())
99 if (!fanart.isEmpty())
106 if (!banner.isEmpty())
123 if (inetref.isEmpty())
131 if (!coverurl.path().isEmpty())
133 coverart = coverurl.path();
134 coverart = coverart.remove(0,1);
138 if (!fanarturl.path().isEmpty())
140 fanart = fanarturl.path();
141 fanart = fanart.remove(0,1);
145 if (!bannerurl.path().isEmpty())
147 banner = bannerurl.path();
148 banner = banner.remove(0,1);
154 prequery.
prepare(
"DELETE FROM recordedartwork WHERE "
155 "inetref = :INETREF AND season = :SEASON;");
160 if (!prequery.
exec())
168 query.
prepare(
"INSERT INTO recordedartwork(inetref,"
169 "season,host,coverart,fanart,banner) VALUES( "
170 ":INETREF, :SEASON, :HOST, :COVERART, "
171 ":FANART, :BANNER);");
static QString generate_file_url(const QString &storage_group, const QString &host, const QString &path)
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
QSqlQuery wrapper that fetches a DB connection from the connection pool.
void bindValueNoNull(const QString &placeholder, const QVariant &val)
Add a single binding, taking care not to set a NULL value.
QVariant value(int i) const
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
static void DBError(const QString &where, const MSqlQuery &query)
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.