Пример #1
0
    def run(self):

        if self.test == 'process':
            print 'testing process'

            processor = Process()

            obj = ImportFile.objects.get(pk=self.if_id)

            media_id = processor.id_by_sha1(obj.file)
            print 'path: %s' % obj.file.path
            print 'media_id: %s', media_id
            """"""
            print
            obj.results_tag = processor.extract_metadata(obj.file)

            self.pp.pprint(obj.results_tag)

            obj.results_acoustid = processor.get_aid(obj.file)
            processor.get_musicbrainz(obj)

        if self.test == 'import':
            print 'testing import'

            importer = Importer()

            obj = ImportFile.objects.get(pk=self.if_id)

            media, status = importer.run(obj)

            print '*************************************'
            print media
Пример #2
0
    def run(self):

        if self.test == "process":
            print "testing process"

            processor = Process()

            obj = ImportFile.objects.get(pk=self.if_id)

            media_id = processor.id_by_sha1(obj.file)
            print "path: %s" % obj.file.path
            print "media_id: %s", media_id

            """"""
            print
            obj.results_tag = processor.extract_metadata(obj.file)

            self.pp.pprint(obj.results_tag)

            obj.results_acoustid = processor.get_aid(obj.file)
            processor.get_musicbrainz(obj)

        if self.test == "import":
            print "testing import"
            importer = Importer()
            obj = ImportFile.objects.get(pk=self.if_id)
            media, status = importer.run(obj)

            print "*************************************"
            print media

        if self.test == "lookup":
            from alibrary.models.artistmodels import Release, Label, Artist
            from importer.util.importer import mb_complete_release_task, mb_complete_label_task

            # "Visitors"
            mb_id = "1924bf90-15e3-4a34-902e-18ba2f11acef"
            obj = Release.objects.get(pk=2137)

            # "American Life"
            mb_id = "a6af8564-2ce7-4ca5-ba02-a5488ebe3083"
            obj = Release.objects.get(pk=2139)

            # Maverik Label
            mb_id = "79afd9ce-c6b2-4e9a-9b23-a13e25d70688"
            obj = Label.objects.get(pk=1005)

            print "name:  %s" % obj.name
            print "mb id: %s" % mb_id

            mb_complete_label_task(obj, mb_id)
Пример #3
0
    def run(self):

        if self.test == 'process':
            print 'testing process'
            
            processor = Process()
            
            obj = ImportFile.objects.get(pk=self.if_id)
            
            media_id = processor.id_by_sha1(obj.file)
            print 'path: %s' % obj.file.path  
            print 'media_id: %s', media_id
            
            """"""
            print
            obj.results_tag = processor.extract_metadata(obj.file)
            
            self.pp.pprint(obj.results_tag)

            
            

            obj.results_acoustid = processor.get_aid(obj.file)
            processor.get_musicbrainz(obj)

        if self.test == 'import':
            print 'testing import'
            
            importer = Importer()
            
            obj = ImportFile.objects.get(pk=self.if_id)

            
            
            media, status = importer.run(obj)
            
            print '*************************************'
            print media