X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/561cc041eb4b1033d16d915345810b4a6abb3a55..94a3d5dc103e37b41a02b5c1c611621e91ba4b75:/src/catalogue/utils.py 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)