X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/561cc041eb4b1033d16d915345810b4a6abb3a55..ff382f6c37063c0c4c5d21c2834a8759e25c5d02:/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)