Skip to content

Doesn't Work With External Audio Sources and Songrec #13

@aftertommy

Description

@aftertommy

I like to listen to music on my turntable, and I use Songrec to recognize what's currently playing. Songrec supports MPRIS:

$ playerctl metadata
re    xesam:title               In the Meantime
re    mpris:artUrl              file:///home/dkurtz/.cache/songrec/songrec_cover_1000_1774250613.jpg
re    xesam:album               Meantime
re    xesam:artist              Helmet
re    xesam:genre               Hard Rock

However, it looks like songfetch fails to run, presumably because it's trying to display a progress bar for a song with an unknown duration(?):

$ songfetch           
Traceback (most recent call last):
  File "/usr/bin/songfetch", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/usr/lib/python3.14/site-packages/songfetch/main.py", line 113, in main
    info_col = get_info_line()
  File "/usr/lib/python3.14/site-packages/songfetch/main.py", line 75, in get_info_line
    f"\033[34m{progress_bar()}\033[0m",
               ~~~~~~~~~~~~^^
  File "/usr/lib/python3.14/site-packages/songfetch/main.py", line 28, in progress_bar
    percentage = pos / dur
                 ~~~~^~~~~
ZeroDivisionError: division by zero

It'd be great if I could make this work somehow!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions