View Single Post
Old 05-20-2026, 12:50 AM   #892
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,801
Karma: 83105959
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by Comfy.n View Post
Found this the other day:

This template returns 🎵
for audio-ebooks, such as: https://www.readbeyond.it/ebooks.html
Code:
python:
def evaluate(book, context):
    import zipfile, os
    try:
        epub_path = context.db.new_api.format_abspath(book.id, 'EPUB')
        if not epub_path or not os.path.exists(epub_path):
            return ''
        with zipfile.ZipFile(epub_path) as ep:
            for name in ep.namelist():
                if name.lower().endswith(('.mp3', '.m4a', '.ogg', '.flac', '.wav', '.wma', '.aac', '.opus')):
                    return '🎵'
    except Exception:
        pass
    return ''
did mean to post in https://www.mobileread.com/forums/sh...d.php?t=100949 ?
ownedbycats is offline   Reply With Quote