Exemplo n.º 1
0
    def process_task(self,filepath):
        # what sort of file is it? Guess the model to use from extension.
        root, ext = splitext(filepath)

        if islink(filepath):
            raise TaskSkipped('Linked file is probably mapped to CAS')

        #if not access(filepath,R_OK):
        #    raise TaskError('Could not access %s' % filepath)

        if ext == '.mp3':
            AudioFile.from_mp3(filepath).save()

        elif ext == '.aac':
            AudioFile.from_aac(filepath).save()
        else:
            raise TaskSkipped('Not a supported file %s' % filepath)
Exemplo n.º 2
0
    def process_task(self, filepath):
        # what sort of file is it? Guess the model to use from extension.
        root, ext = splitext(filepath)

        if islink(filepath):
            raise TaskSkipped('Linked file is probably mapped to CAS')

        #if not access(filepath,R_OK):
        #    raise TaskError('Could not access %s' % filepath)

        if ext == '.mp3':
            AudioFile.from_mp3(filepath).save()

        elif ext == '.aac':
            AudioFile.from_aac(filepath).save()
        else:
            raise TaskSkipped('Not a supported file %s' % filepath)