Skip to content

Commit

Permalink
Updated to v2.6.0-stable.20240311
Browse files Browse the repository at this point in the history
- Fixed prettier warnings.
- Fixed a bug related to importing 'didyoumean2' package.
- Removed .npmrc file
  • Loading branch information
Sandakan committed Mar 11, 2024
1 parent 5741d7c commit 33a5bb6
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 81 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ out
thunder-tests
coverage/
*.m3u
.npmrc
2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@
"presentation": {
"hidden": true
}
},
{
"name": "Main - attach",
"port": 5858,
"request": "attach",
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
"type": "node",
"timeout": 15000,
"restart": {
"delay": 1000,
"maxAttempts": 10
},
"showAsyncStacks": true,
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
"sourceMaps": true,
"outFiles": ["${workspaceFolder}/out/**/*.js", "!**/node_modules/**"]
}
],
"compounds": [
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,6 @@
"editor.tokenColorCustomizations": {
"comments": "#00b894",
"textMateRules": []
}
},
"typescript.tsdk": "node_modules\\typescript\\lib"
}
28 changes: 14 additions & 14 deletions __tests__/hasDataChanged.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ describe('hasDataChanged function check', () => {

test('Complex comparisons with boolean returns', () => {
const obj1 = {
songs: [{ songId: 'GsEGhFOgMA', title: 'Love Like This' }],
songs: [{ songId: 'GsEGhFOgMA', title: 'Love Like This' }]
};

const obj2 = {
songs: [{ songId: 'GsEGhFOgMA', title: 'Love Like This' }],
songs: [{ songId: 'GsEGhFOgMA', title: 'Love Like This' }]
};

const obj3 = {
Expand All @@ -43,9 +43,9 @@ describe('hasDataChanged function check', () => {
picture_medium:
'https://e-cdns-images.dzcdn.net/images/artist/2c54c5a0b0593a1c454def8cf6f31902/250x250-000000-80-0-0.jpg',
picture_xl:
'https://e-cdns-images.dzcdn.net/images/artist/2c54c5a0b0593a1c454def8cf6f31902/1000x1000-000000-80-0-0.jpg',
},
},
'https://e-cdns-images.dzcdn.net/images/artist/2c54c5a0b0593a1c454def8cf6f31902/1000x1000-000000-80-0-0.jpg'
}
}
],
album: {
title: 'Love Like This',
Expand All @@ -56,7 +56,7 @@ describe('hasDataChanged function check', () => {
songs: [{ songId: 'GsEGhFOgMA', title: 'Love Like This' }],
noOfSongs: 1,
artworkPath:
'nora:\\localFiles\\C:\\Users\\adsan\\AppData\\Roaming\\Nora\\song_covers\\GsEGhFOgMA.webp?ts=1699108835053',
'nora:\\localFiles\\C:\\Users\\adsan\\AppData\\Roaming\\Nora\\song_covers\\GsEGhFOgMA.webp?ts=1699108835053'
},
genres: [],
releasedYear: 2020,
Expand All @@ -67,7 +67,7 @@ describe('hasDataChanged function check', () => {
duration: 182.47,
trackNumber: 1,
isLyricsSavePending: false,
isMetadataSavePending: false,
isMetadataSavePending: false
};
const obj4 = {
title: 'Love Like This',
Expand All @@ -84,9 +84,9 @@ describe('hasDataChanged function check', () => {
picture_medium:
'https://e-cdns-images.dzcdn.net/images/artist/2c54c5a0b0593a1c454def8cf6f31902/250x250-000000-80-0-0.jpg',
picture_xl:
'https://e-cdns-images.dzcdn.net/images/artist/2c54c5a0b0593a1c454def8cf6f31902/1000x1000-000000-80-0-0.jpg',
},
},
'https://e-cdns-images.dzcdn.net/images/artist/2c54c5a0b0593a1c454def8cf6f31902/1000x1000-000000-80-0-0.jpg'
}
}
],
album: {
title: 'Love Like This',
Expand All @@ -97,7 +97,7 @@ describe('hasDataChanged function check', () => {
songs: [{ songId: 'GsEGhFOgMA', title: 'Love Like This' }],
noOfSongs: 1,
artworkPath:
'nora:\\localFiles\\C:\\Users\\adsan\\AppData\\Roaming\\Nora\\song_covers\\GsEGhFOgMA.webp?ts=1699108835053',
'nora:\\localFiles\\C:\\Users\\adsan\\AppData\\Roaming\\Nora\\song_covers\\GsEGhFOgMA.webp?ts=1699108835053'
},
genres: [],
releasedYear: 2020,
Expand All @@ -108,11 +108,11 @@ describe('hasDataChanged function check', () => {
duration: 182.47,
trackNumber: 1,
isLyricsSavePending: false,
isMetadataSavePending: false,
isMetadataSavePending: false
};

const output1 = {
songs: false,
songs: false
};

const output2 = {
Expand All @@ -126,7 +126,7 @@ describe('hasDataChanged function check', () => {
releasedYear: false,
synchronizedLyrics: false,
title: false,
trackNumber: false,
trackNumber: false
};

expect(hasDataChanged(obj1, obj1)).toStrictEqual(output1);
Expand Down
12 changes: 3 additions & 9 deletions __tests__/isLatestVersion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,9 @@ describe('App versions check', () => {
});

test('Versions with same release phases and different build metadata', () => {
expect(
isLatestVersion('2.0.0-stable.20230515', '2.0.0-stable.20230510'),
).toBe(true);
expect(isLatestVersion('2.0.0-beta20230510', '2.0.0-beta20230515')).toBe(
true,
);
expect(
isLatestVersion('2.0.0-alpha.20250101', '2.0.0-alpha.19990509'),
).toBe(true);
expect(isLatestVersion('2.0.0-stable.20230515', '2.0.0-stable.20230510')).toBe(true);
expect(isLatestVersion('2.0.0-beta20230510', '2.0.0-beta20230515')).toBe(true);
expect(isLatestVersion('2.0.0-alpha.20250101', '2.0.0-alpha.19990509')).toBe(true);
});

test('Versions with different release phases', () => {
Expand Down
78 changes: 38 additions & 40 deletions __tests__/parseLyrics.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TagConstants } from 'node-id3';
import parseLyrics, {
SyncedLyricsInput,
parseSyncedLyricsFromAudioDataSource,
parseSyncedLyricsFromAudioDataSource
} from '../src/main/utils/parseLyrics';

// const songMetadata = `[ti:Stay]
Expand All @@ -17,14 +17,14 @@ const syncedLyricsFromSongMetadata: SyncedLyricsInput = {
synchronisedText: [
{
text: 'Waiting for the time to pass you by',
timeStamp: 9810,
timeStamp: 9810
},
{
text: 'Hope the winds of change will change your mind',
timeStamp: 14060,
timeStamp: 14060
},
{ text: 'I could give a thousand reasons why', timeStamp: 19110 },
],
{ text: 'I could give a thousand reasons why', timeStamp: 19110 }
]
};

const syncedLyricsString = `[00:09.81] Waiting for the time to pass you by
Expand All @@ -48,7 +48,7 @@ describe('Check the full output of parseLyrics function', () => {
copyright: undefined,
lyrics: [
'This <00:15.138> party <00:16.273> is <00:16.563> too <00:17.116> loud',
'I <00:18.365> see <00:18.817> you <00:19.643> with <00:19.972> her <00:20.28> now',
'I <00:18.365> see <00:18.817> you <00:19.643> with <00:19.972> her <00:20.28> now'
],
syncedLyrics: [
{
Expand All @@ -57,81 +57,81 @@ describe('Check the full output of parseLyrics function', () => {
text: 'This',
unparsedText: '[00:14.871] This',
start: 14.871,
end: 15.138,
end: 15.138
},
{
text: 'party',
unparsedText: '<00:15.138> party',
start: 15.138,
end: 16.273,
end: 16.273
},
{
text: 'is',
unparsedText: '<00:16.273> is',
start: 16.273,
end: 16.563,
end: 16.563
},
{
text: 'too',
unparsedText: '<00:16.563> too',
start: 16.563,
end: 17.116,
end: 17.116
},
{
text: 'loud',
unparsedText: '<00:17.116> loud',
start: 17.116,
end: 18.113,
},
end: 18.113
}
],
start: 14.871,
end: 18.113,
end: 18.113
},
{
text: [
{
text: 'I',
unparsedText: '[00:18.113] I',
start: 18.113,
end: 18.365,
end: 18.365
},
{
text: 'see',
unparsedText: '<00:18.365> see',
start: 18.365,
end: 18.817,
end: 18.817
},
{
text: 'you',
unparsedText: '<00:18.817> you',
start: 18.817,
end: 19.643,
end: 19.643
},
{
text: 'with',
unparsedText: '<00:19.643> with',
start: 19.643,
end: 19.972,
end: 19.972
},
{
text: 'her',
unparsedText: '<00:19.972> her',
start: 19.972,
end: 20.28,
end: 20.28
},
{
text: 'now',
unparsedText: '<00:20.28> now',
start: 20.28,
end: Number.POSITIVE_INFINITY,
},
end: Number.POSITIVE_INFINITY
}
],
start: 18.113,
end: Number.POSITIVE_INFINITY,
},
end: Number.POSITIVE_INFINITY
}
],
unparsedLyrics: enhancedSyncedLyricsString,
offset: 0,
offset: 0
});
});

Expand All @@ -145,27 +145,27 @@ describe('Check the full output of parseLyrics function', () => {
lyrics: [
'Waiting for the time to pass you by',
'Hope the winds of change will change your mind',
'I could give a thousand reasons why',
'I could give a thousand reasons why'
],
syncedLyrics: [
{
text: 'Waiting for the time to pass you by',
start: 9.81,
end: 14.06,
end: 14.06
},
{
text: 'Hope the winds of change will change your mind',
start: 14.06,
end: 19.11,
end: 19.11
},
{
text: 'I could give a thousand reasons why',
start: 19.11,
end: Number.POSITIVE_INFINITY,
},
end: Number.POSITIVE_INFINITY
}
],
unparsedLyrics: syncedLyricsString,
offset: 0,
offset: 0
});
});

Expand All @@ -179,18 +179,16 @@ describe('Check the full output of parseLyrics function', () => {
lyrics: [
'Waiting for the time to pass you by',
'Hope the winds of change will change your mind',
'I could give a thousand reasons why',
'I could give a thousand reasons why'
],
syncedLyrics: undefined,
unparsedLyrics: unsyncedLyricsString,
offset: 0,
offset: 0
});
});

test('Parsing synced lyrics from audio data source', () => {
const parsedLyrics = parseSyncedLyricsFromAudioDataSource(
syncedLyricsFromSongMetadata,
);
const parsedLyrics = parseSyncedLyricsFromAudioDataSource(syncedLyricsFromSongMetadata);
console.log('Parsed Synced Lyrics from Audio Source : \n', parsedLyrics);

expect(parsedLyrics).toEqual<LyricsData>({
Expand All @@ -199,27 +197,27 @@ describe('Check the full output of parseLyrics function', () => {
lyrics: [
'Waiting for the time to pass you by',
'Hope the winds of change will change your mind',
'I could give a thousand reasons why',
'I could give a thousand reasons why'
],
syncedLyrics: [
{
text: 'Waiting for the time to pass you by',
start: 9.81,
end: 14.06,
end: 14.06
},
{
text: 'Hope the winds of change will change your mind',
start: 14.06,
end: 19.11,
end: 19.11
},
{
text: 'I could give a thousand reasons why',
start: 19.11,
end: Number.POSITIVE_INFINITY,
},
end: Number.POSITIVE_INFINITY
}
],
unparsedLyrics: syncedLyricsString,
offset: 0,
offset: 0
});
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"typecheck:web": "tsc --noEmit -p tsconfig.web.json --composite false",
"typecheck": "npm run typecheck:node && npm run typecheck:web",
"start": "electron-vite preview",
"dev": "electron-vite dev --inspect",
"dev": "electron-vite dev --inspect --sourcemap --watch",
"build": "electron-vite build",
"postinstall": "electron-builder install-app-deps",
"build:unpack": "npm run build && electron-builder --dir",
Expand Down
File renamed without changes.
Loading

0 comments on commit 33a5bb6

Please sign in to comment.