Skip to content

Commit

Permalink
Update the seektables when a filename changes on scan in MythVideo.
Browse files Browse the repository at this point in the history
Patch from Johnny Stenback.  Fixes #9415.
  • Loading branch information
Robert McNamara committed Jan 28, 2011
1 parent c2304c0 commit a0fcdbb
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions mythtv/libs/libmythmetadata/videometadata.cpp
Expand Up @@ -910,7 +910,7 @@ int VideoMetadata::UpdateHashedDBRecord(const QString &hash,
{
MSqlQuery query(MSqlQuery::InitCon());

query.prepare("SELECT intid FROM videometadata WHERE "
query.prepare("SELECT intid,filename FROM videometadata WHERE "
"hash = :HASH");
query.bindValue(":HASH", hash);

Expand All @@ -924,6 +924,7 @@ int VideoMetadata::UpdateHashedDBRecord(const QString &hash,
return -1;

int intid = query.value(0).toInt();
QString oldfilename = query.value(1).toString();

query.prepare("UPDATE videometadata SET filename = :FILENAME, "
"host = :HOST WHERE intid = :INTID");
Expand All @@ -933,7 +934,18 @@ int VideoMetadata::UpdateHashedDBRecord(const QString &hash,

if (!query.exec() || !query.isActive())
{
MythDB::DBError("Video hashed metadata update", query);
MythDB::DBError("Video hashed metadata update (videometadata)", query);
return -1;
}

query.prepare("UPDATE filemarkup SET filename = :FILENAME "
"WHERE filename = :OLDFILENAME");
query.bindValue(":FILENAME", file_name);
query.bindValue(":OLDFILENAME", oldfilename);

if (!query.exec() || !query.isActive())
{
MythDB::DBError("Video hashed metadata update (filemarkup)", query);
return -1;
}

Expand Down

0 comments on commit a0fcdbb

Please sign in to comment.