[tasks] Fix scrobbling tasks

This commit is contained in:
2024-10-05 15:49:22 -04:00
parent c251c5f413
commit 7c6c1cee6d
6 changed files with 12 additions and 11 deletions

View File

@ -313,11 +313,11 @@ def manual_scrobble_task(url: str, user_id: int):
if "shortcut" in url:
source = "Shortcut"
title = "Generic Shortcut task"
description = url.split("/")[-1]
description = " ".join(url.split("/")[-1].split("-")).capitalize
if "todoist" in url:
source = "Todoist"
title = "Generic Todoist task"
description = url.split("-")[-1]
description = " ".join(url.split("/")[-1].split("-")[:-1]).capitalize
task = Task.find_or_create(title)
@ -337,7 +337,6 @@ def manual_scrobble_task(url: str, user_id: int):
"media_type": Scrobble.MediaType.WEBPAGE,
},
)
scrobble = Scrobble.create_or_update(task, user_id, scrobble_dict)
return scrobble