mirror of
https://github.com/fergalmoran/dss.git
synced 2025-12-22 09:38:18 +00:00
Added management command to tag mp3s
This commit is contained in:
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
0
_working/create
Normal file → Executable file
0
_working/create
Normal file → Executable file
0
_working/get_downloads.sql
Normal file → Executable file
0
_working/get_downloads.sql
Normal file → Executable file
0
_working/get_plays.sql
Normal file → Executable file
0
_working/get_plays.sql
Normal file → Executable file
0
apache/django_live.wsgi
Normal file → Executable file
0
apache/django_live.wsgi
Normal file → Executable file
0
core/__init__.py
Normal file → Executable file
0
core/__init__.py
Normal file → Executable file
0
core/analytics/__init__.py
Normal file → Executable file
0
core/analytics/__init__.py
Normal file → Executable file
0
core/analytics/google.py
Normal file → Executable file
0
core/analytics/google.py
Normal file → Executable file
0
core/decorators.py
Normal file → Executable file
0
core/decorators.py
Normal file → Executable file
0
core/serialisers/__init__.py
Normal file → Executable file
0
core/serialisers/__init__.py
Normal file → Executable file
0
core/serialisers/json.py
Normal file → Executable file
0
core/serialisers/json.py
Normal file → Executable file
@@ -1,3 +0,0 @@
|
|||||||
from core.social._Social import _Social
|
|
||||||
class Facebook(_Social):
|
|
||||||
pass
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
class _Social:
|
|
||||||
pass
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
__author__ = 'fergalm'
|
|
||||||
0
core/tasks.py
Normal file → Executable file
0
core/tasks.py
Normal file → Executable file
0
core/tests/__init__.py
Normal file → Executable file
0
core/tests/__init__.py
Normal file → Executable file
0
core/tests/mix.py
Normal file → Executable file
0
core/tests/mix.py
Normal file → Executable file
0
core/utils/__init__.py
Normal file → Executable file
0
core/utils/__init__.py
Normal file → Executable file
0
core/utils/audio/__init__.py
Normal file → Executable file
0
core/utils/audio/__init__.py
Normal file → Executable file
30
core/utils/audio/mp3.py
Normal file → Executable file
30
core/utils/audio/mp3.py
Normal file → Executable file
@@ -1,3 +1,4 @@
|
|||||||
|
from mutagen.easyid3 import EasyID3, mutagen
|
||||||
from mutagen.mp3 import MP3
|
from mutagen.mp3 import MP3
|
||||||
from core.utils.audio import Mp3FileNotFoundException
|
from core.utils.audio import Mp3FileNotFoundException
|
||||||
|
|
||||||
@@ -7,4 +8,31 @@ def mp3_length(source_file):
|
|||||||
audio = MP3(source_file)
|
audio = MP3(source_file)
|
||||||
return audio.info.length
|
return audio.info.length
|
||||||
except IOError:
|
except IOError:
|
||||||
raise Mp3FileNotFoundException("Audio file not found: %s" % source_file)
|
raise Mp3FileNotFoundException("Audio file not found: %s" % source_file)
|
||||||
|
|
||||||
|
|
||||||
|
def tag_mp3(source_file, artist, title, album="", year="", comment="", image_file="", genre=[]):
|
||||||
|
#mp3Object.tags.add(APIC(encoding=3, mime=image[1], type=3, desc=u'Cover', data=open(image[0]).read()))
|
||||||
|
|
||||||
|
info = EasyID3(source_file)
|
||||||
|
info['artist'] = unicode(artist)
|
||||||
|
info['title'] = unicode(title)
|
||||||
|
info['album'] = unicode(album)
|
||||||
|
info['genre'] = unicode("Deep House")
|
||||||
|
#info['year'] = unicode(year)
|
||||||
|
info.save()
|
||||||
|
|
||||||
|
id3 = mutagen.id3.ID3(source_file)
|
||||||
|
frame = mutagen.id3.COMM(encoding=3, lang='XXX', desc=u'', text=[unicode(comment)])
|
||||||
|
id3.add(frame)
|
||||||
|
|
||||||
|
image = mutagen.id3.APIC(
|
||||||
|
encoding=3,
|
||||||
|
mime='image/jpeg',
|
||||||
|
type=2,
|
||||||
|
desc=u'Cover',
|
||||||
|
data=open(image_file, 'rb').read()
|
||||||
|
)
|
||||||
|
id3.add(image)
|
||||||
|
id3.save()
|
||||||
|
|
||||||
|
|||||||
0
core/utils/file.py
Normal file → Executable file
0
core/utils/file.py
Normal file → Executable file
0
core/utils/html.py
Normal file → Executable file
0
core/utils/html.py
Normal file → Executable file
0
core/utils/live.py
Normal file → Executable file
0
core/utils/live.py
Normal file → Executable file
0
core/utils/string.py
Normal file → Executable file
0
core/utils/string.py
Normal file → Executable file
0
core/utils/url.py
Normal file → Executable file
0
core/utils/url.py
Normal file → Executable file
0
core/utils/waveform.py
Normal file → Executable file
0
core/utils/waveform.py
Normal file → Executable file
0
core/widgets/__init__.py
Normal file → Executable file
0
core/widgets/__init__.py
Normal file → Executable file
0
core/widgets/upload.py
Normal file → Executable file
0
core/widgets/upload.py
Normal file → Executable file
0
dss/__init__.py
Normal file → Executable file
0
dss/__init__.py
Normal file → Executable file
0
dss/localsettings.initial.py
Normal file → Executable file
0
dss/localsettings.initial.py
Normal file → Executable file
0
dss/logsettings.py
Normal file → Executable file
0
dss/logsettings.py
Normal file → Executable file
2
dss/settings.py
Normal file → Executable file
2
dss/settings.py
Normal file → Executable file
@@ -52,7 +52,7 @@ USE_TZ = True
|
|||||||
|
|
||||||
SITE_ROOT = here('')
|
SITE_ROOT = here('')
|
||||||
MEDIA_ROOT = localsettings.MEDIA_ROOT
|
MEDIA_ROOT = localsettings.MEDIA_ROOT
|
||||||
STATIC_ROOT = here('static') #'/var/www/deepsouthsounds.com/static' # here('static') #localsettings.STATIC_ROOT if hasattr(localsettings, 'STATIC_ROOT') else ''
|
STATIC_ROOT = here('static')
|
||||||
CACHE_ROOT = localsettings.CACHE_ROOT
|
CACHE_ROOT = localsettings.CACHE_ROOT
|
||||||
|
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
|
|||||||
0
dss/urls.py
Normal file → Executable file
0
dss/urls.py
Normal file → Executable file
0
dss/warning_settings.py
Normal file → Executable file
0
dss/warning_settings.py
Normal file → Executable file
0
dss/wsgi.py
Normal file → Executable file
0
dss/wsgi.py
Normal file → Executable file
0
index.html
Normal file → Executable file
0
index.html
Normal file → Executable file
0
pip_upgrade.py
Normal file → Executable file
0
pip_upgrade.py
Normal file → Executable file
0
requirements.txt
Normal file → Executable file
0
requirements.txt
Normal file → Executable file
0
spa/__init__.py
Normal file → Executable file
0
spa/__init__.py
Normal file → Executable file
0
spa/admin.py
Normal file → Executable file
0
spa/admin.py
Normal file → Executable file
0
spa/ajax.py
Normal file → Executable file
0
spa/ajax.py
Normal file → Executable file
0
spa/api/__init__.py
Normal file → Executable file
0
spa/api/__init__.py
Normal file → Executable file
0
spa/api/v1/ActivityResource.py
Normal file → Executable file
0
spa/api/v1/ActivityResource.py
Normal file → Executable file
0
spa/api/v1/BackboneCompatibleResource.py
Normal file → Executable file
0
spa/api/v1/BackboneCompatibleResource.py
Normal file → Executable file
0
spa/api/v1/ChatResource.py
Normal file → Executable file
0
spa/api/v1/ChatResource.py
Normal file → Executable file
0
spa/api/v1/CommentResource.py
Normal file → Executable file
0
spa/api/v1/CommentResource.py
Normal file → Executable file
0
spa/api/v1/EventResource.py
Normal file → Executable file
0
spa/api/v1/EventResource.py
Normal file → Executable file
0
spa/api/v1/MixResource.py
Normal file → Executable file
0
spa/api/v1/MixResource.py
Normal file → Executable file
0
spa/api/v1/ReleaseAudioResource.py
Normal file → Executable file
0
spa/api/v1/ReleaseAudioResource.py
Normal file → Executable file
0
spa/api/v1/ReleaseResource.py
Normal file → Executable file
0
spa/api/v1/ReleaseResource.py
Normal file → Executable file
0
spa/api/v1/UserResource.py
Normal file → Executable file
0
spa/api/v1/UserResource.py
Normal file → Executable file
0
spa/api/v1/__init__.py
Normal file → Executable file
0
spa/api/v1/__init__.py
Normal file → Executable file
0
spa/api/v1/tests.py
Normal file → Executable file
0
spa/api/v1/tests.py
Normal file → Executable file
0
spa/audio.py
Normal file → Executable file
0
spa/audio.py
Normal file → Executable file
0
spa/context_processors.py
Normal file → Executable file
0
spa/context_processors.py
Normal file → Executable file
0
spa/forms.py
Normal file → Executable file
0
spa/forms.py
Normal file → Executable file
0
spa/management/__init__.py
Normal file → Executable file
0
spa/management/__init__.py
Normal file → Executable file
0
spa/management/commands/__init__.py
Normal file → Executable file
0
spa/management/commands/__init__.py
Normal file → Executable file
0
spa/management/commands/debug.py
Normal file → Executable file
0
spa/management/commands/debug.py
Normal file → Executable file
0
spa/management/commands/deletefailed.py
Normal file → Executable file
0
spa/management/commands/deletefailed.py
Normal file → Executable file
0
spa/management/commands/deleteorphanmp3.py
Normal file → Executable file
0
spa/management/commands/deleteorphanmp3.py
Normal file → Executable file
0
spa/management/commands/drop.py
Normal file → Executable file
0
spa/management/commands/drop.py
Normal file → Executable file
0
spa/management/commands/importdownloads.py
Normal file → Executable file
0
spa/management/commands/importdownloads.py
Normal file → Executable file
0
spa/management/commands/importplays.py
Normal file → Executable file
0
spa/management/commands/importplays.py
Normal file → Executable file
0
spa/management/commands/processmix.py
Normal file → Executable file
0
spa/management/commands/processmix.py
Normal file → Executable file
0
spa/management/commands/processuser.py
Normal file → Executable file
0
spa/management/commands/processuser.py
Normal file → Executable file
0
spa/management/commands/purchaselinks.py
Normal file → Executable file
0
spa/management/commands/purchaselinks.py
Normal file → Executable file
16
spa/management/commands/tagmix.py
Normal file
16
spa/management/commands/tagmix.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
from django.core.management.base import NoArgsCommand
|
||||||
|
from spa.models.mix import Mix
|
||||||
|
|
||||||
|
|
||||||
|
class Command(NoArgsCommand):
|
||||||
|
help = "Create tracklists for all mixes"
|
||||||
|
|
||||||
|
def handle_noargs(self, **options):
|
||||||
|
print "Tagging audio files"
|
||||||
|
mixes = Mix.objects.all()
|
||||||
|
for mix in mixes:
|
||||||
|
print "Tagging: %s" % mix.title
|
||||||
|
mix.create_mp3_tags()
|
||||||
|
|
||||||
|
print "Finished tagging"
|
||||||
|
|
||||||
0
spa/management/commands/tracklists.py
Normal file → Executable file
0
spa/management/commands/tracklists.py
Normal file → Executable file
0
spa/management/commands/waveforms.py
Normal file → Executable file
0
spa/management/commands/waveforms.py
Normal file → Executable file
0
spa/middleware/__init__.py
Normal file → Executable file
0
spa/middleware/__init__.py
Normal file → Executable file
0
spa/middleware/sqlprinter.py
Normal file → Executable file
0
spa/middleware/sqlprinter.py
Normal file → Executable file
0
spa/middleware/stripwhitespace.py
Normal file → Executable file
0
spa/middleware/stripwhitespace.py
Normal file → Executable file
0
spa/middleware/uploadify.py
Normal file → Executable file
0
spa/middleware/uploadify.py
Normal file → Executable file
0
spa/migrations/0001_initial.py
Normal file → Executable file
0
spa/migrations/0001_initial.py
Normal file → Executable file
0
spa/migrations/0002_auto__add_userfollows.py
Normal file → Executable file
0
spa/migrations/0002_auto__add_userfollows.py
Normal file → Executable file
0
spa/migrations/0003_auto__add_field_mix_duration.py
Normal file → Executable file
0
spa/migrations/0003_auto__add_field_mix_duration.py
Normal file → Executable file
0
spa/migrations/0004_auto__add_field_mix_slug.py
Normal file → Executable file
0
spa/migrations/0004_auto__add_field_mix_slug.py
Normal file → Executable file
0
spa/migrations/0005_auto__chg_field_userprofile_slug.py
Normal file → Executable file
0
spa/migrations/0005_auto__chg_field_userprofile_slug.py
Normal file → Executable file
0
spa/migrations/0006_auto__chg_field_mix_title.py
Normal file → Executable file
0
spa/migrations/0006_auto__chg_field_mix_title.py
Normal file → Executable file
0
spa/migrations/0006_auto__chg_field_userprofile_user.py
Normal file → Executable file
0
spa/migrations/0006_auto__chg_field_userprofile_user.py
Normal file → Executable file
0
spa/migrations/0007_auto__del_userfollows__chg_field_mix_title.py
Normal file → Executable file
0
spa/migrations/0007_auto__del_userfollows__chg_field_mix_title.py
Normal file → Executable file
0
spa/migrations/0008_auto__add_field_userprofile_followers__add_field_userprofile_following.py
Normal file → Executable file
0
spa/migrations/0008_auto__add_field_userprofile_followers__add_field_userprofile_following.py
Normal file → Executable file
0
spa/migrations/0009_auto__del_field_userprofile_followers__del_field_userprofile_following.py
Normal file → Executable file
0
spa/migrations/0009_auto__del_field_userprofile_followers__del_field_userprofile_following.py
Normal file → Executable file
0
spa/migrations/0010_auto.py
Normal file → Executable file
0
spa/migrations/0010_auto.py
Normal file → Executable file
0
spa/migrations/0011_auto__del_field__activity_user.py
Normal file → Executable file
0
spa/migrations/0011_auto__del_field__activity_user.py
Normal file → Executable file
0
spa/migrations/0012_auto__add_field__activity_user.py
Normal file → Executable file
0
spa/migrations/0012_auto__add_field__activity_user.py
Normal file → Executable file
0
spa/migrations/0013_auto__del_mixfavourite__add_usermixfavourite.py
Normal file → Executable file
0
spa/migrations/0013_auto__del_mixfavourite__add_usermixfavourite.py
Normal file → Executable file
0
spa/migrations/0014_auto__del_usermixfavourite__add_mixfavourite.py
Normal file → Executable file
0
spa/migrations/0014_auto__del_usermixfavourite__add_mixfavourite.py
Normal file → Executable file
0
spa/migrations/0015_auto__chg_field_mixfavourite_user.py
Normal file → Executable file
0
spa/migrations/0015_auto__chg_field_mixfavourite_user.py
Normal file → Executable file
0
spa/migrations/0016_auto__del_mixlike.py
Normal file → Executable file
0
spa/migrations/0016_auto__del_mixlike.py
Normal file → Executable file
0
spa/migrations/0017_auto__add_mixlike.py
Normal file → Executable file
0
spa/migrations/0017_auto__add_mixlike.py
Normal file → Executable file
0
spa/migrations/0018_auto__del_mixdownload__del_mixlike__del__activity__del_mixplay__del_mi.py
Normal file → Executable file
0
spa/migrations/0018_auto__del_mixdownload__del_mixlike__del__activity__del_mixplay__del_mi.py
Normal file → Executable file
0
spa/migrations/0019_auto__add_activityfavourite.py
Normal file → Executable file
0
spa/migrations/0019_auto__add_activityfavourite.py
Normal file → Executable file
0
spa/migrations/0020_auto__add_activityplay.py
Normal file → Executable file
0
spa/migrations/0020_auto__add_activityplay.py
Normal file → Executable file
0
spa/migrations/0021_auto__add_activitylike.py
Normal file → Executable file
0
spa/migrations/0021_auto__add_activitylike.py
Normal file → Executable file
0
spa/migrations/0022_auto__add_activitydownload.py
Normal file → Executable file
0
spa/migrations/0022_auto__add_activitydownload.py
Normal file → Executable file
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user