return f;
}
+File Database::getFileByPath(const QString &path)
+{
+ QSqlQuery q(d->db);
+ q.prepare("SELECT fid from file_location WHERE path = :path");
+ q.bindValue(":path", path);
+
+ if (!exec(q))
+ return File();
+
+ if (!q.next())
+ return File();
+
+ int fid = q.value(0).toInt();
+ return getFile(fid);
+}
+
bool Database::setAnime(const Anime &anime)
{
d->setAnimeQuery.bindValue(":aid", anime.aid);
Anime getAnime(int aid);
Episode getEpisode(int eid);
File getFile(int fid);
+ File getFileByPath(const QString &path);
bool setAnime(const Anime &anime);
bool setEpisode(const Episode &episode);