X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/561cc041eb4b1033d16d915345810b4a6abb3a55..29f694eea94d09bd66976321ddfd80ac30b73d38:/src/catalogue/utils.py?ds=sidebyside diff --git a/src/catalogue/utils.py b/src/catalogue/utils.py index 2f3b94964..380ec8ecd 100644 --- a/src/catalogue/utils.py +++ b/src/catalogue/utils.py @@ -354,3 +354,8 @@ def gallery_path(slug): def gallery_url(slug): return '%s%s%s/' % (settings.MEDIA_URL, settings.IMAGE_DIR, slug) + + +def get_mp3_length(path): + from mutagen.mp3 import MP3 + return int(MP3(path).info.length)