Example #1
0
	def discovered_cb(self, discoverer, info, error):
		tags = info.get_tags()
		for tagname in ('image', 'preview-image'):
			(found, sample) = tags.get_sample(tagname)
			if not found:
				print("no %s" % tagname)
				continue

			pixbuf = RB.gst_process_embedded_image(tags, tagname)
			if not pixbuf:
				print("no pixbuf in %s" % tagname)
				continue

			print("trying to store pixbuf from %s" % tagname)
			key = RB.ExtDBKey.create_storage("album", self.search_key.get_field("album"))
			artists = self.search_key.get_field_values("artist")
			key.add_field("artist", artists[0])
			self.store.store(key, RB.ExtDBSourceType.EMBEDDED, pixbuf)
			return
Example #2
0
    def discovered_cb(self, discoverer, info, error):
        tags = info.get_tags()
        for tagname in ('image', 'preview-image'):
            (found, sample) = tags.get_sample(tagname)
            if not found:
                print("no %s" % tagname)
                continue

            pixbuf = RB.gst_process_embedded_image(tags, tagname)
            if not pixbuf:
                print("no pixbuf in %s" % tagname)
                continue

            print("trying to store pixbuf from %s" % tagname)
            key = RB.ExtDBKey.create_storage(
                "album", self.search_key.get_field("album"))
            artists = self.search_key.get_field_values("artist")
            key.add_field("artist", artists[0])
            self.store.store(key, RB.ExtDBSourceType.EMBEDDED, pixbuf)
            return