Quodlibet: Website Search plugin: KeyError: '~filename' when using a conditional tag with comparisons

Created on 5 Feb 2018  路  4Comments  路  Source: quodlibet/quodlibet

I configured this search URL pattern in the Website Search plugin:

https://google.com/search?q=<~dirname = /Various Artists/|<album>|<artist~album>>

and this exception is thrown when I select it:

KeyError: '~filename'
------
Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/quodlibet/qltk/songsmenu.py", line 203, in __handle
    ret = plugin.plugin_songs(songs)

  File "/usr/lib/python3/dist-packages/quodlibet/ext/songsmenu/website_search.py", line 144, in plugin_songs
    url = str(pat.format(subs))

  File "/usr/lib/python3/dist-packages/quodlibet/pattern/_pattern.py", line 247, in format
    value = u"".join(self.__func(self.SongProxy(song, self._format)))

  File "<string>", line 6, in f

  File "/usr/lib/python3/dist-packages/quodlibet/query/_match.py", line 543, in search
    if search(fsn2text(data(name, fs_default))):

  File "/usr/lib/python3/dist-packages/quodlibet/pattern/_pattern.py", line 218, in __call__
    return self.__song(key, *args)

  File "/usr/lib/python3/dist-packages/quodlibet/formats/_audio.py", line 387, in __call__
    return os.path.dirname(self["~filename"]) or self["~filename"]

KeyError: '~filename'

I keep albums with multiple artists under directory _Various Artists_, so when I search one of these albums, I don't wanna use the artist name, only the album name.

bug

All 4 comments

Thanks, replicated on latest(ish) master

Wow, that was quick ! I guess I'll wait for the next update in ppa:lazka/dumpingplace to test it. Thanks !

I've just read the Development Guide and learned I could clone the git repo and run QL from the source without installing. So, yes, it's working, problem solved ! Once again, thanks @declension !

No worries :smile:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kyle-fredrickson picture kyle-fredrickson  路  5Comments

lazka picture lazka  路  6Comments

jeronimojoe picture jeronimojoe  路  5Comments

Valeryan24 picture Valeryan24  路  6Comments

lazka picture lazka  路  4Comments