]> kaliko git repositories - mpd-goodies.git/commitdiff
* write properly end lines in playlist /o\
authorkaliko <kaliko@azylum.org>
Wed, 9 Dec 2009 09:21:56 +0000 (09:21 +0000)
committerkaliko <kaliko@azylum.org>
Wed, 9 Dec 2009 09:21:56 +0000 (09:21 +0000)
mtopls

diff --git a/mtopls b/mtopls
index d44788920dc61d33cb898d3057e143022a66d5ca..e1d5dace9c86f6b867069cdf2a9c0e2b31fb7bd3 100755 (executable)
--- a/mtopls
+++ b/mtopls
@@ -48,7 +48,6 @@ class MtoPls(object):
         self.cli = mconnect()
         self.current = self.cli.currentsong()
         self.cli.disconnect()
-        print self.current
         self._consume_sopt()
         self._create_playlist()
         self._controls_perm()
@@ -91,6 +90,7 @@ class MtoPls(object):
 
     def _create_playlist(self):
         if not isfile(self.pls_path):
+            # TODO: add M3U header
             sys.stdout.write('Create new playlist: %s\n' % self.pls_path)
             open(self.pls_path, 'a').close()
 
@@ -108,8 +108,10 @@ class MtoPls(object):
 
     def _run(self):
         """"""
+        # TODO: controls file is not already in playlist
         fd = open(self.pls_path, 'a')
         fd.write(self.current.get('file'))
+        fd.write('\n')
         fd.close()
 
 # Script starts here