saltfish 0.3.51 → 0.3.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9691,31 +9691,37 @@ class TriggerManager {
|
|
|
9691
9691
|
/**
|
|
9692
9692
|
* Evaluates all registered triggers against current conditions
|
|
9693
9693
|
* Called by TransitionManager when URL changes occur
|
|
9694
|
+
* Stops after the first playlist is triggered to prevent multiple playlists from conflicting
|
|
9694
9695
|
*/
|
|
9695
9696
|
evaluateAllTriggers() {
|
|
9696
9697
|
if (!this.isMonitoring || this.triggeredPlaylists.length === 0) {
|
|
9697
9698
|
return;
|
|
9698
9699
|
}
|
|
9699
9700
|
for (const playlist of this.triggeredPlaylists) {
|
|
9700
|
-
this.evaluatePlaylistTrigger(playlist);
|
|
9701
|
+
const wasTriggered = this.evaluatePlaylistTrigger(playlist);
|
|
9702
|
+
if (wasTriggered) {
|
|
9703
|
+
log(`TriggerManager: Playlist ${playlist.id} was triggered, stopping further evaluations`);
|
|
9704
|
+
break;
|
|
9705
|
+
}
|
|
9701
9706
|
}
|
|
9702
9707
|
}
|
|
9703
9708
|
/**
|
|
9704
9709
|
* Evaluates triggers for a specific playlist
|
|
9705
9710
|
* @param playlist - The playlist to evaluate triggers for
|
|
9711
|
+
* @returns true if the playlist was triggered, false otherwise
|
|
9706
9712
|
*/
|
|
9707
9713
|
evaluatePlaylistTrigger(playlist) {
|
|
9708
9714
|
if (!playlist.triggers) {
|
|
9709
|
-
return;
|
|
9715
|
+
return false;
|
|
9710
9716
|
}
|
|
9711
9717
|
const { triggers } = playlist;
|
|
9712
9718
|
const playlistId = playlist.id;
|
|
9713
9719
|
if (this.triggeredPlaylistsSet.has(playlistId)) {
|
|
9714
|
-
return;
|
|
9720
|
+
return false;
|
|
9715
9721
|
}
|
|
9716
9722
|
const store = getSaltfishStore();
|
|
9717
9723
|
if (!store.user) {
|
|
9718
|
-
return;
|
|
9724
|
+
return false;
|
|
9719
9725
|
}
|
|
9720
9726
|
const conditions = [];
|
|
9721
9727
|
const watchedPlaylists = this.getWatchedPlaylists();
|
|
@@ -9743,7 +9749,9 @@ class TriggerManager {
|
|
|
9743
9749
|
log(`TriggerManager: Final evaluation for playlist ${playlistId}: ${shouldTrigger} (operator: ${triggers.operators.join(", ")})`);
|
|
9744
9750
|
if (shouldTrigger) {
|
|
9745
9751
|
this.triggerPlaylist(playlistId);
|
|
9752
|
+
return true;
|
|
9746
9753
|
}
|
|
9754
|
+
return false;
|
|
9747
9755
|
}
|
|
9748
9756
|
/**
|
|
9749
9757
|
* Gets watched playlists from backend userData or localStorage (for anonymous users)
|
|
@@ -12045,7 +12053,7 @@ const SaltfishPlayer$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
12045
12053
|
__proto__: null,
|
|
12046
12054
|
SaltfishPlayer
|
|
12047
12055
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
12048
|
-
const version = "0.3.
|
|
12056
|
+
const version = "0.3.52";
|
|
12049
12057
|
const packageJson = {
|
|
12050
12058
|
version
|
|
12051
12059
|
};
|