Cleaned up tagging

This commit is contained in:
Fergal Moran
2013-06-22 19:12:15 +01:00
parent 3b115b21ad
commit 01b8069aca
2 changed files with 7 additions and 2 deletions

View File

@@ -7,8 +7,8 @@ class Command(NoArgsCommand):
def handle_noargs(self, **options):
print "Tagging audio files"
#mixes = Mix.objects.filter(uid='6e2576bc-aba9-4717-9f9f-dede31fc2eaa')
mixes = Mix.objects.all()
mixes = Mix.objects.filter(uid='3af66ac3-ff29-4b24-85a6-ae6ac774ca07')
#mixes = Mix.objects.all()
for mix in mixes:
print "Tagging: %s" % mix.title
mix.create_mp3_tags()

View File

@@ -79,6 +79,7 @@ class Mix(_BaseModel):
image_file=os.path.join(image.storage.base_location, image.name),
genre=self.genres)
except Exception, ex:
self.logger.error("Mix: error creating tags: %s" % ex.message)
pass
def get_absolute_path(self, prefix=""):
@@ -116,6 +117,10 @@ class Mix(_BaseModel):
return self.user.get_medium_profile_image()
return None
def get_image_absolute_path(self):
name, extension = os.path.splitext(self.mix_image.file.name)
return os.path.join(settings.MEDIA_ROOT, 'mix-images', "%s.%s", (self.uid, extension))
def get_image_url(self):
try:
ret = get_thumbnail(self.mix_image, '160x160', crop='center')