Skip to content
Browse files

Alter VIDEO_LIST_UPDATE to detail what videos have been added, deleted,

or moved.  Information is provided as a list, in the form:

    action::intid

Where action can be 'added', 'moved', or 'deleted'.

This bumps the protocol version to 68.
  • Loading branch information...
1 parent d5977cf commit a17e689bdc00df4f04ca77a60c454eefed81d786 @wagnerrp wagnerrp committed Jul 9, 2011
View
4 mythtv/bindings/perl/MythTV.pm
@@ -106,8 +106,8 @@ package MythTV;
# Note: as of July 21, 2010, this is actually a string, to account for proto
# versions of the form "58a". This will get used if protocol versions are
# changed on a fixes branch ongoing.
- our $PROTO_VERSION = "67";
- our $PROTO_TOKEN = "0G0G0G0";
+ our $PROTO_VERSION = "68";
+ our $PROTO_TOKEN = "90094EAD";
# currentDatabaseVersion is defined in libmythtv in
# mythtv/libs/libmythtv/dbcheck.cpp and should be the current MythTV core
View
4 mythtv/bindings/php/MythBackend.php
@@ -11,8 +11,8 @@ class MythBackend {
// MYTH_PROTO_VERSION is defined in libmyth in mythtv/libs/libmyth/mythcontext.h
// and should be the current MythTV protocol version.
- static $protocol_version = '67';
- static $protocol_token = '0G0G0G0';
+ static $protocol_version = '68';
+ static $protocol_token = '90094EAD';
// The character string used by the backend to separate records
static $backend_separator = '[]:[]';
View
4 mythtv/bindings/python/MythTV/static.py
@@ -8,8 +8,8 @@
SCHEMA_VERSION = 1278
NVSCHEMA_VERSION = 1007
MUSICSCHEMA_VERSION = 1018
-PROTO_VERSION = '67'
-PROTO_TOKEN = '0G0G0G0'
+PROTO_VERSION = '68'
+PROTO_TOKEN = '90094EAD'
BACKEND_SEP = '[]:[]'
INSTALL_PREFIX = '/usr/local'
View
5 mythtv/libs/libmythbase/mythversion.h
@@ -35,9 +35,8 @@
* mythtv/bindings/python/MythTV/static.py (version number)
* mythtv/bindings/python/MythTV/mythproto.py (layout)
*/
-#define MYTH_PROTO_VERSION "67"
-#define MYTH_PROTO_TOKEN "0G0G0G0"
-
+#define MYTH_PROTO_VERSION "68"
+#define MYTH_PROTO_TOKEN "90094EAD"
MBASE_PUBLIC const char *GetMythSourceVersion();
#endif
View
31 mythtv/libs/libmythmetadata/videoscan.cpp
@@ -18,6 +18,7 @@
#include "videometadatalistmanager.h"
#include "videoscan.h"
#include "videoutils.h"
+#include "mythevent.h"
#include "remoteutil.h"
#include "mythlogging.h"
@@ -140,8 +141,23 @@ class VideoScannerThread : public QThread
PurgeList db_remove;
verifyFiles(fs_files, db_remove);
m_DBDataChanged = updateDB(fs_files, db_remove);
+
if (m_DBDataChanged)
- RemoteSendMessage("VIDEO_LIST_CHANGE");
+ {
+ QStringList slist;
+
+ QList<int>::const_iterator i;
+ for (i = m_addList.begin(); i != m_addList.end(); ++i)
+ slist << QString("added::%1").arg(*i);
+ for (i = m_movList.begin(); i != m_movList.end(); ++i)
+ slist << QString("moved::%1").arg(*i);
+ for (i = m_delList.begin(); i != m_delList.end(); ++i)
+ slist << QString("deleted::%1").arg(*i);
+
+ MythEvent me("VIDEO_LIST_CHANGE", slist);
+
+ RemoteSendEvent(me);
+ }
threadDeregister();
}
@@ -244,7 +260,6 @@ class VideoScannerThread : public QThread
{
int ret = 0;
uint counter = 0;
- QList<int> preservelist;
if (m_HasGUI)
SendProgressEvent(counter, (uint)(add.size() + remove.size()),
tr("Updating video database"));
@@ -270,7 +285,7 @@ class VideoScannerThread : public QThread
"database, updating record %2 "
"with new filename %3")
.arg(hash).arg(id).arg(p->first));
- preservelist.append(id);
+ m_movList.append(id);
}
}
if (id == -1)
@@ -299,6 +314,7 @@ class VideoScannerThread : public QThread
.arg(hash));
newFile.SetHost(p->second.host);
newFile.SaveToDatabase();
+ m_addList << newFile.GetID();
}
ret += 1;
}
@@ -311,8 +327,11 @@ class VideoScannerThread : public QThread
for (PurgeList::const_iterator p = remove.begin(); p != remove.end();
++p)
{
- if (!preservelist.contains(p->first))
+ if (!m_movList.contains(p->first))
+ {
removeOrphans(p->first, p->second);
+ m_delList << p->first;
+ }
if (m_HasGUI)
SendProgressEvent(++counter);
}
@@ -344,7 +363,6 @@ class VideoScannerThread : public QThread
QApplication::postEvent(m_dialog, pue);
}
-
bool m_ListUnknown;
bool m_RemoveAll;
bool m_KeepAll;
@@ -355,6 +373,9 @@ class VideoScannerThread : public QThread
VideoMetadataListManager *m_dbmetadata;
MythUIProgressDialog *m_dialog;
+ QList<int> m_addList; // newly added intids
+ QList<int> m_movList; // intids moved to new filename
+ QList<int> m_delList; // orphaned/deleted intids
bool m_DBDataChanged;
};

0 comments on commit a17e689

Please sign in to comment.
Something went wrong with that request. Please try again.