Sfoglia il codice sorgente

[scrobbles] Stop any scrobble when stop is called

Colin Powell 1 giorno fa
parent
commit
30b005fa46
1 ha cambiato i file con 7 aggiunte e 2 eliminazioni
  1. 7 2
      vrobbler/apps/scrobbles/scrobblers.py

+ 7 - 2
vrobbler/apps/scrobbles/scrobblers.py

@@ -868,8 +868,13 @@ def manual_scrobble_webpage(
     )
 
     scrobble = Scrobble.create_or_update(webpage, user_id, scrobble_dict)
-    # possibly async this?
-    scrobble.push_to_archivebox()
+
+    if action == "stop":
+        scrobble.stop(force_finish=True)
+    else:
+        # possibly async this?
+        scrobble.push_to_archivebox()
+
     return scrobble