Skip to content
Permalink
Browse files

Update the seektables when a filename changes on scan in MythVideo.

Patch from Johnny Stenback.  Fixes #9415.
  • Loading branch information
Robert McNamara
Robert McNamara committed Jan 28, 2011
1 parent c2304c0 commit a0fcdbbc8ae485c7cd72bc414aa569b65dfe40ca
Showing with 14 additions and 2 deletions.
  1. +14 −2 mythtv/libs/libmythmetadata/videometadata.cpp
@@ -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);

@@ -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");
@@ -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;
}

0 comments on commit a0fcdbb

Please sign in to comment.
You can’t perform that action at this time.