[scrobbles] LastFM only creates import if there are imports
This commit is contained in:
@ -93,7 +93,7 @@ class LastFM:
|
||||
)
|
||||
return created
|
||||
|
||||
def get_last_scrobbles(self, time_from=None, time_to=None):
|
||||
def get_last_scrobbles(self, time_from=None, time_to=None, check=False):
|
||||
"""Given a user, Last.fm api key, and secret key, grab a list of scrobbled
|
||||
tracks"""
|
||||
lfm_params = {}
|
||||
@ -109,6 +109,9 @@ class LastFM:
|
||||
found_scrobbles = self.user.get_recent_tracks(**lfm_params)
|
||||
# TOOD spin this out into a celery task over certain threshold of found scrobbles?
|
||||
|
||||
if check and found_scrobbles:
|
||||
return True
|
||||
|
||||
for scrobble in found_scrobbles:
|
||||
logger.info(f"Processing {scrobble}")
|
||||
run_time = None
|
||||
|
||||
Reference in New Issue
Block a user