Save playlist digest on loading.
authorW. Trevor King <wking@drexel.edu>
Thu, 13 May 2010 14:08:54 +0000 (10:08 -0400)
committerW. Trevor King <wking@drexel.edu>
Thu, 13 May 2010 14:08:54 +0000 (10:08 -0400)
The previous implementation felt that playlists were not saved
(.is_saved() -> False) when the playlists had not been altered since
loading.

We *don't* save the digest when we load from a string, because
that string is not necessarily on disk and we *do* want to save
it, even if the playlist hasn't change since loading.

I also removed the return bits, since FilePlaylist._from_xml_doc()
doesn't return anything.

hooke/playlist.py

index 0be9e1e66dd972932c9bf83a1eca1e7d1230702b..1d5e994f7b1c75e5bead1245f07283268fe299dc 100644 (file)
@@ -224,14 +224,15 @@ class FilePlaylist (Playlist):
         path/to/curve/two
         """
         doc = xml.dom.minidom.parseString(string)
-        return self._from_xml_doc(doc)
+        self._from_xml_doc(doc)
 
     def load(self, path=None):
         """Load a playlist from a file.
         """
         self.set_path(path)
         doc = xml.dom.minidom.parse(self.path)
-        return self._from_xml_doc(doc)
+        self._from_xml_doc(doc)
+        self._digest = self.digest()
 
     def save(self, path=None):
         """Saves the playlist in a XML file.