]> git.parisson.com Git - telemeta.git/commitdiff
No metadata in caching path (just ext/item_id.ext). No verbose by default
authoryomguy <>
Mon, 23 Apr 2007 15:24:47 +0000 (15:24 +0000)
committeryomguy <>
Mon, 23 Apr 2007 15:24:47 +0000 (15:24 +0000)
telemeta/export/core.py
telemeta/export/flac.py
telemeta/export/ogg.py
telemeta/export/wav.py

index 06db1d1b732c057b0481d3000c97e9e4b2841d63..b8b64f3c49522f04a6fe4c7d3f3dbba5df4a1cc1 100644 (file)
@@ -95,11 +95,10 @@ class ExporterCore(Component):
                xml.dom.ext.PrettyPrint(doc, xml_file)
                xml_file.close()
 
-
        def pre_process(self, item_id, source, metadata, ext, cache_dir, options):
                """ Pre processing of the core. Prepare the export path and
                return it"""
-               self.item_id = item_id
+               self.item_id = str(item_id)
                self.source = source
                file_name = get_file_name(self.source)
                file_name_wo_ext, file_ext = split_file_name(file_name)
@@ -107,9 +106,9 @@ class ExporterCore(Component):
                self.options = options
 
                self.metadata = metadata
-               self.collection = self.metadata['Collection']
-               self.artist = self.metadata['Artist']
-               self.title = self.metadata['Title']
+               #self.collection = self.metadata['Collection']
+               #self.artist = self.metadata['Artist']
+               #self.title = self.metadata['Title']
 
                # Decode the source if needed
                if os.path.exists(self.source) and not iswav16(self.source):
@@ -127,8 +126,9 @@ class ExporterCore(Component):
                # At the moment, the target directory is built with this scheme in
                # the cache directory : ./%Format/%Collection/%Artist/
                self.dest = self.cache_dir
-               export_dir = os.path.join(self.ext,self.collection,self.artist)
 
+               #export_dir = os.path.join(self.ext,self.collection,self.artist)
+               export_dir = self.ext
                if not os.path.exists(os.path.join(self.dest,export_dir)):
                        for _dir in export_dir.split(os.sep):
                                self.dest = os.path.join(self.dest,_dir)
@@ -138,7 +138,8 @@ class ExporterCore(Component):
                        self.dest = os.path.join(self.dest,export_dir)
 
                # Set the target file
-               target_file = file_name_wo_ext+'.'+self.ext
+               #target_file = file_name_wo_ext+'.'+self.ext
+               target_file = self.item_id+'.'+self.ext
                self.dest = os.path.join(self.dest,target_file)
                return self.dest
 
@@ -245,3 +246,4 @@ def get_consts_value(self, data):
        value = self.collection.__dict__[data]
        value_type = getType(value)
        return value, value_type
+
index c7cae565071749010b85141fc07ae89f8f9bf5c1..68a31f4f7a273c626a68f4d101cabd4a153de67d 100644 (file)
@@ -95,7 +95,9 @@ class FlacExporter(ExporterCore):
                else:
                        args = '-f -V -'+self.quality_default
 
-               if 'verbose' in self.options and self.options['verbose'] == '0':
+               if 'verbose' in self.options and self.options['verbose'] != '0':
+                       args = args
+               else:
                        args = args+' -s'
        
                try:
index a1ec2133aeb841c13a60af95ebdf868bcd2132b9..f81ba08e671f1ce4f0cf3fe03bffc8d231abdf25 100644 (file)
@@ -85,7 +85,9 @@ class OggExporter(ExporterCore):
                else:
                        args = '-b '+self.bitrate_default
 
-               if 'verbose' in self.options and self.options['verbose'] == '0':
+               if 'verbose' in self.options and self.options['verbose'] != '0':
+                       args = args
+               else:
                        args = args + ' -Q'
                
                if os.path.exists(self.source) and not iswav16(self.source):
index 9cf679fc8c5eec844f756f0c665ca4501660cd15..52b32b1454bc459702a6b91c2b003fc59dbc9460 100644 (file)
@@ -87,8 +87,11 @@ class WavExporter(ExporterCore):
        def create_par_key(self):
                """ Create the par2 keys of the dest """
                args = 'c -n1 '
-               if 'verbose' in self.options and self.options['verbose'] == '0':
+               if 'verbose' in self.options and self.options['verbose'] != '0':
+                       args = args
+               else:
                        args = args + '-q -q '
+
                try:
                        os.system('par2 '+args+' "'+self.dest+'"')
                except IOError: