Giter Club home page Giter Club logo

mopidy-notify's People

Contributors

phijor avatar

Watchers

 avatar  avatar

mopidy-notify's Issues

Fails if a track's image is 'None'

ERROR    2023-08-08 13:30:15,290 [27475:NotifyFrontend-18 (_actor_loop)] mopidy.listener
  Triggering event failed: track_playback_started(tl_track)
Traceback (most recent call last):
  File "/home/abadger/.local/lib/python3.11/site-packages/mopidy/listener.py", line 44, in on_event
    getattr(self, event)(**kwargs)
  File "/home/abadger/.local/lib/python3.11/site-packages/mopidy_notify/frontend.py", line 43, in track_playback_started
    self.show_notification(tl_track)
  File "/home/abadger/.local/lib/python3.11/site-packages/mopidy_notify/frontend.py", line 75, in show_notification
    icon = self.fetch_icon(track.uri)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/abadger/.local/lib/python3.11/site-packages/mopidy_notify/frontend.py", line 127, in fetch_icon
    preferred = self.find_preferred_image(images)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/abadger/.local/lib/python3.11/site-packages/mopidy_notify/frontend.py", line 107, in find_preferred_image
    acceptable = [i for i in images if i.width <= self.ext_config["max_icon_size"]]
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/abadger/.local/lib/python3.11/site-packages/mopidy_notify/frontend.py", line 107, in <listcomp>
    acceptable = [i for i in images if i.width <= self.ext_config["max_icon_size"]]
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '<=' not supported between instances of 'NoneType' and 'int'

It seems that some Mopidy backends will supply an icon with each track, but the icons are all 'None' objects. mopidy-notify does not expect this and throws an exception instead of ignoring the invalid image.
So far I've had this happen with every track from the following backends:

  • mopidy-youtube
  • mopidy-podcast
  • mopidy-somafm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.