[black] Reformat to use 88 line lengths
This commit is contained in:
@ -43,9 +43,7 @@ def import_scrobbles_from_imap() -> list[Scrobble]:
|
||||
|
||||
try:
|
||||
message = email.message_from_bytes(msg_data[0][1])
|
||||
logger.info(
|
||||
"Processing email message", extra={"email_msg": message}
|
||||
)
|
||||
logger.info("Processing email message", extra={"email_msg": message})
|
||||
except IndexError:
|
||||
logger.info("No email message data found")
|
||||
return
|
||||
@ -75,9 +73,7 @@ def import_scrobbles_from_imap() -> list[Scrobble]:
|
||||
if filename.lower().endswith(".bgsplay"):
|
||||
# TODO Pull this out into a parse_pgsplay function
|
||||
try:
|
||||
parsed_json = json.loads(
|
||||
file_data.decode("utf-8")
|
||||
)
|
||||
parsed_json = json.loads(file_data.decode("utf-8"))
|
||||
except Exception as e:
|
||||
logger.error(
|
||||
"Failed to parse JSON file",
|
||||
|
||||
@ -54,9 +54,7 @@ class LastFM:
|
||||
lfm_scrobble.get("timestamp")
|
||||
)
|
||||
timestamp = lfm_scrobble.get("timestamp")
|
||||
stop_timestamp = timestamp + timedelta(
|
||||
seconds=track.run_time_seconds
|
||||
)
|
||||
stop_timestamp = timestamp + timedelta(seconds=track.run_time_seconds)
|
||||
new_scrobble = Scrobble(
|
||||
user=self.vrobbler_user,
|
||||
timestamp=timestamp,
|
||||
@ -149,13 +147,11 @@ class LastFM:
|
||||
|
||||
# TODO figure out if this will actually work
|
||||
# timestamp = datetime.fromtimestamp(int(scrobble.timestamp), UTC)
|
||||
timestamp = datetime.utcfromtimestamp(
|
||||
int(scrobble.timestamp)
|
||||
).replace(tzinfo=pytz.utc)
|
||||
|
||||
logger.info(
|
||||
f"Scrobble appended to list for bulk create", extra=log_dict
|
||||
timestamp = datetime.utcfromtimestamp(int(scrobble.timestamp)).replace(
|
||||
tzinfo=pytz.utc
|
||||
)
|
||||
|
||||
logger.info(f"Scrobble appended to list for bulk create", extra=log_dict)
|
||||
scrobbles.append(
|
||||
{
|
||||
"artist": artist,
|
||||
|
||||
@ -20,9 +20,7 @@ def import_from_webdav_for_all_users(restart=False):
|
||||
webdav_pass__isnull=False,
|
||||
webdav_auto_import=True,
|
||||
).values_list("user_id", flat=True)
|
||||
logger.info(
|
||||
f"Start import of {webdav_enabled_user_ids.count()} webdav accounts"
|
||||
)
|
||||
logger.info(f"Start import of {webdav_enabled_user_ids.count()} webdav accounts")
|
||||
|
||||
koreader_import_count = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user