[scrobbles] LastFM only creates import if there are imports

This commit is contained in:
2025-07-25 22:53:31 -04:00
parent 66e805542c
commit 4eb8289e55
2 changed files with 31 additions and 1 deletions

View File

@ -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