Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

Commit

Permalink
fix: resolves th-ch#978
Browse files Browse the repository at this point in the history
  • Loading branch information
JellyBrick committed Sep 13, 2023
1 parent ad8b9c9 commit 7d355ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@
"html-to-text": "9.0.5",
"keyboardevent-from-electron-accelerator": "2.0.0",
"keyboardevents-areequal": "0.2.2",
"md5": "2.3.0",
"mpris-service": "2.1.2",
"node-id3": "0.2.6",
"simple-youtube-age-restriction-bypass": "git+https://github.com/MiepHD/Simple-YouTube-Age-Restriction-Bypass.git#v2.5.5",
Expand All @@ -173,7 +172,6 @@
"@types/electron-localshortcut": "^3.1.0",
"@types/howler": "^2.2.8",
"@types/html-to-text": "^9.0.1",
"@types/md5": "^2.3.2",
"@types/youtube-player": "^5.5.7",
"@typescript-eslint/eslint-plugin": "6.7.0",
"auto-changelog": "2.4.0",
Expand Down
10 changes: 4 additions & 6 deletions plugins/last-fm/back.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import crypto from 'node:crypto';

import { BrowserWindow, net, shell } from 'electron';
import md5 from 'md5';

import { setOptions } from '../../config/plugins';
import registerCallback, { SongInfo } from '../../providers/song-info';
Expand Down Expand Up @@ -37,10 +38,7 @@ const createQueryString = (parameters: Record<string, unknown>, apiSignature: st

const createApiSig = (parameters: Record<string, unknown>, secret: string) => {
// This function creates the api signature, see: https://www.last.fm/api/authspec
const keys = [];
for (const key in parameters) {
keys.push(key);
}
const keys = Object.keys(parameters);

keys.sort();
let sig = '';
Expand All @@ -53,7 +51,7 @@ const createApiSig = (parameters: Record<string, unknown>, secret: string) => {
}

sig += secret;
sig = md5(sig);
sig = crypto.createHash('md5').update(sig, 'utf-8').digest('hex');
return sig;
};

Expand Down

0 comments on commit 7d355ea

Please sign in to comment.