Skip to content

Commit

Permalink
LastFM - Fix allowing updateNowPlaying when not playing
Browse files Browse the repository at this point in the history
  • Loading branch information
Inrixia committed Jun 21, 2024
1 parent fe67c34 commit a61ede4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/LastFM/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export { Settings } from "./Settings";

// @ts-expect-error Remove this when types are available
import { storage } from "@plugin";
import { undefinedWarn } from "../../../lib/undefinedError";
import { ExtendedTrackItem } from "../../../lib/Caches/ExtendedTrackItem";

let totalPlayTime = 0;
Expand All @@ -23,6 +22,7 @@ const MIN_SCROBBLE_PERCENTAGE = 0.5; // Minimum percentage of song duration requ

let currentTrack: CurrentTrack;
const updateNowPlaying = async (playbackContext?: PlaybackContext) => {
if (store.getState().playbackControls.desiredPlaybackState !== "PLAYING") return;
currentTrack = await getCurrentTrack(playbackContext);
const nowPlayingParams = await getTrackParams(currentTrack);
console.log("[last.fm] updatingNowPlaying", nowPlayingParams);
Expand Down

0 comments on commit a61ede4

Please sign in to comment.