summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-10-16 23:08:31 +0100
committerCarl Hetherington <cth@carlh.net>2013-10-16 23:08:31 +0100
commit5072adc82cf6ae088bb6e08af8bbef2d0d49914c (patch)
tree48399cd467f0648a6e771ff26652e5e079ab0ab3 /src/lib
parentb07f8b2ea71d50d7da76f8929d47c56e3807c59f (diff)
Content trim and position in the digests used to decide whether or not a rebuild is necessary.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/content.cc17
-rw-r--r--src/lib/content.h1
-rw-r--r--src/lib/video_content.cc2
3 files changed, 19 insertions, 1 deletions
diff --git a/src/lib/content.cc b/src/lib/content.cc
index d2a07f795..dbb841200 100644
--- a/src/lib/content.cc
+++ b/src/lib/content.cc
@@ -26,6 +26,7 @@
#include "ui_signaller.h"
using std::string;
+using std::stringstream;
using std::set;
using boost::shared_ptr;
using boost::lexical_cast;
@@ -174,3 +175,19 @@ Content::trimmed (Time t) const
{
return (t < trim_start() || t > (full_length() - trim_end ()));
}
+
+/** @return string which includes everything about how this content affects
+ * its playlist.
+ */
+string
+Content::identifier () const
+{
+ stringstream s;
+
+ s << Content::digest()
+ << "_" << position()
+ << "_" << trim_start()
+ << "_" << trim_end();
+
+ return s.str ();
+}
diff --git a/src/lib/content.h b/src/lib/content.h
index 3c57dddbe..9c7ad2fc2 100644
--- a/src/lib/content.h
+++ b/src/lib/content.h
@@ -58,6 +58,7 @@ public:
virtual std::string information () const = 0;
virtual void as_xml (xmlpp::Node *) const;
virtual Time full_length () const = 0;
+ virtual std::string identifier () const;
boost::shared_ptr<Content> clone () const;
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc
index 23ef2cf89..347836855 100644
--- a/src/lib/video_content.cc
+++ b/src/lib/video_content.cc
@@ -227,7 +227,7 @@ string
VideoContent::identifier () const
{
stringstream s;
- s << Content::digest()
+ s << Content::identifier()
<< "_" << crop().left
<< "_" << crop().right
<< "_" << crop().top