X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/561cc041eb4b1033d16d915345810b4a6abb3a55..f083ac4cb1be9bb6c14ce2045be90e0cdf23508e:/src/catalogue/utils.py?ds=inline 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)