diff --git a/mopidy/frontends/lastfm.py b/mopidy/frontends/lastfm.py index 33e724c0..d50f8dd8 100644 --- a/mopidy/frontends/lastfm.py +++ b/mopidy/frontends/lastfm.py @@ -74,14 +74,14 @@ class LastfmFrontend(ThreadingActor, BackendListener): pylast.MalformedResponseError, pylast.WSError) as e: logger.warning(u'Error submitting playing track to Last.fm: %s', e) - def stopped_playing(self, track, stop_position): + def stopped_playing(self, track, time_position): artists = ', '.join([a.name for a in track.artists]) duration = track.length and track.length // 1000 or 0 - stop_position = stop_position // 1000 + time_position = time_position // 1000 if duration < 30: logger.debug(u'Track too short to scrobble. (30s)') return - if stop_position < duration // 2 and stop_position < 240: + if time_position < duration // 2 and time_position < 240: logger.debug( u'Track not played long enough to scrobble. (50% or 240s)') return diff --git a/tests/backends/local/playback_test.py b/tests/backends/local/playback_test.py index 5f80e691..6aec680f 100644 --- a/tests/backends/local/playback_test.py +++ b/tests/backends/local/playback_test.py @@ -37,7 +37,7 @@ class LocalPlaybackControllerTest(PlaybackControllerTest, unittest.TestCase): self.backend.current_playlist.add(track) def test_uri_scheme(self): - self.assertIn('file', self.backend.uri_schemes) + self.assert_('file' in self.backend.uri_schemes) def test_play_mp3(self): self.add_track('blank.mp3')