forked from rc/aircox
WIP - Sound.file instead of Sound.path; fix issues with player; program.path is now relative
This commit is contained in:
@ -28,7 +28,7 @@ class SoundInline(admin.TabularInline):
|
||||
max_num = 0
|
||||
|
||||
def audio(self, obj):
|
||||
return mark_safe('<audio src="{}" controls></audio>'.format(obj.url()))
|
||||
return mark_safe('<audio src="{}" controls></audio>'.format(obj.file.url))
|
||||
audio.short_descripton = _('Audio')
|
||||
|
||||
def get_queryset(self, request):
|
||||
@ -46,10 +46,10 @@ class SoundAdmin(admin.ModelAdmin):
|
||||
|
||||
search_fields = ['name', 'program__title']
|
||||
fieldsets = [
|
||||
(None, {'fields': ['name', 'path', 'type', 'program', 'episode']}),
|
||||
(None, {'fields': ['name', 'file', 'type', 'program', 'episode']}),
|
||||
(None, {'fields': ['duration', 'is_public', 'is_good_quality', 'mtime']}),
|
||||
]
|
||||
readonly_fields = ('path', 'duration',)
|
||||
readonly_fields = ('file', 'duration',)
|
||||
inlines = [SoundTrackInline]
|
||||
|
||||
def related(self, obj):
|
||||
@ -59,7 +59,7 @@ class SoundAdmin(admin.ModelAdmin):
|
||||
related.short_description = _('Program / Episode')
|
||||
|
||||
def audio(self, obj):
|
||||
return mark_safe('<audio src="{}" controls></audio>'.format(obj.url()))
|
||||
return mark_safe('<audio src="{}" controls></audio>'.format(obj.file.url))
|
||||
audio.short_descripton = _('Audio')
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user