Skip to content

Commit

Permalink
fix undefined check
Browse files Browse the repository at this point in the history
  • Loading branch information
Uriopass committed Aug 14, 2023
1 parent e220a30 commit 469fbda
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions musidex-web/src/pages/merge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const Merge = (props: MergeProps) => {
continue;
}
let duration = meta.music_tags_idx.get(m1)?.get("duration")?.integer;
if (duration === undefined) {
continue;
}
for (let j = i + 1; j < meta.musics.length; j++) {
let m2 = meta.musics[j] || 0;
// @ts-ignore
Expand All @@ -39,6 +42,9 @@ const Merge = (props: MergeProps) => {
continue;
}
let duration2 = meta.music_tags_idx.get(m2)?.get("duration")?.integer;
if (duration2 === undefined) {
continue;
}
if (s > similarity && Math.abs(duration - duration2) <= 15) {
// @ts-ignore
dups.push([m1, m2, s]);
Expand Down

0 comments on commit 469fbda

Please sign in to comment.