def get_recent_tracks(username, number): recent_tracks = lastfm_network.get_user( username).get_recent_tracks(limit=number) for i, track in enumerate(recent_tracks): printable = unicode_track_and_timestamp(track) print_it(str(i+1) + " " + printable) return recent_tracks
def unscrobble(library, scrobble): artist = str(scrobble.track.artist) title = scrobble.track.title timestamp = scrobble.timestamp try: my_library.remove_scrobble( artist=artist, title=title, timestamp=timestamp) except AttributeError as e: print("Exception: " + str(e)) sys.exit( "Error: pylast 0.5.11 does not support removing scrobbles. " "Please install latest pylast: pip install -U pylast") except Exception as e: sys.exit("Exception: " + str(e)) print_it("Scrobble removed: " + unicode_track_and_timestamp(scrobble))
def unscrobble(library, scrobble): artist = str(scrobble.track.artist) title = scrobble.track.title timestamp = scrobble.timestamp try: my_library.remove_scrobble(artist=artist, title=title, timestamp=timestamp) except AttributeError as e: print("Exception: " + str(e)) sys.exit("Error: pylast 0.5.11 does not support removing scrobbles. " "Please install latest pylast: pip install -U pylast") except Exception as e: sys.exit("Exception: " + str(e)) print_it("Scrobble removed: " + unicode_track_and_timestamp(scrobble))