Create Duplicate Finder plugin #3401

Closed
AndreaB54 wants to merge 1 commit from patch-2 into master
AndreaB54 commented 2025-05-27 04:26:37 +00:00 (Migrated from github.com)
No description provided.
@ -0,0 +174,4 @@
const distance = matrix[normalized2.length][normalized1.length];
const maxLength = Math.max(normalized1.length, normalized2.length);
return Math.round(((maxLength - distance) / maxLength) * 100);
};
Owner

we already have a library for string similarity, although it's a different algorithm

import { jaroWinkler } from '@skyra/jaro-winkler';
we already have a library for string similarity, although it's a different algorithm ```typescript import { jaroWinkler } from '@skyra/jaro-winkler'; ```
@ -0,0 +188,4 @@
const albumEl = element.querySelector('[class*="album"]');
const durationEl = element.querySelector('[class*="duration"]') ||
element.querySelector('time');
Owner

You can combine the selectors

          const titleEl = element.querySelector(`.title, [class*="title"], a[href*="/watch"]`);
          const artistEl = element.querySelector(`.subtitle, [class*="artist"], [class*="secondary"]`);
          
          const albumEl = element.querySelector('[class*="album"]');
          const durationEl = element.querySelector('[class*="duration"], time');
You can combine the selectors ```suggestion const titleEl = element.querySelector(`.title, [class*="title"], a[href*="/watch"]`); const artistEl = element.querySelector(`.subtitle, [class*="artist"], [class*="secondary"]`); const albumEl = element.querySelector('[class*="album"]'); const durationEl = element.querySelector('[class*="duration"], time'); ```
Owner

Since you made an entire folder for this plugin, might as well split the backend/menu/renderer into separate files instead of having one big index.ts file.

Since you made an entire folder for this plugin, might as well split the backend/menu/renderer into separate files instead of having one big `index.ts` file.
Owner

PS: Please write what your plugin does in the PR's description.

PS: Please write what your plugin does in the PR's description.

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: YTMD/youtube-music#3401
No description provided.