Skip to content

Commit

Permalink
fix #96 RealMAX infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Inrixia committed Nov 6, 2024
1 parent ef42362 commit c85e29f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/_lib/MaxTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ export type TrackFilter = (trackItem: Resource) => boolean;
export class MaxTrack {
public static getMaxTrack = AsyncCachable(async (itemId: ItemId): Promise<TrackItem | false> => {
for await (const trackItem of this.getTracksFromItemId(itemId, this.hasHiRes)) {
return trackItem;
if (trackItem.id !== itemId) return trackItem;
}
return false;
});
public static getLatestMaxTrack = AsyncCachable(async (itemId: ItemId): Promise<TrackItem | false> => {
let currentTrackItem: TrackItem | false = false;
for await (const trackItem of this.getTracksFromItemId(itemId)) {
if (trackItem.id === itemId) continue;
if (currentTrackItem === undefined) {
currentTrackItem = trackItem;
continue;
Expand Down

0 comments on commit c85e29f

Please sign in to comment.