-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added a schema to validate release-notes.json - Added support for saving LRC files in a seperate folder other than the folder that the relevant song is located. - Added support for renaming a playlist. - Added a log entry to save the time taken to complete processes such as full library parsing, palette generation etc. - Fixed a bug where default artist artworks are not displayed. - Added support for sending album artist with the scrobble song payload. - Added support for reading album artists in songs. - Fixed a bug where albums are created using data from artist tag in a song instead of the albumArtist tag. - Sortings songs with `track number` now also considers their disk numbers. - Added a fade-in animation when images are displayed. - Improved animations in lyrics lines. - Added up next song popup for the mini-player. - Fixed a bug where sorting option is not saved in FoldersPage and PlaylistInfoPage. - Added a button to clear app local storage data.
- Loading branch information
Showing
45 changed files
with
925 additions
and
381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-06/schema#", | ||
"$ref": "#/definitions/Changelog", | ||
"definitions": { | ||
"Changelog": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"latestVersion": { | ||
"$ref": "#/definitions/Version" | ||
}, | ||
"versions": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/Version" | ||
} | ||
} | ||
}, | ||
"required": ["latestVersion", "versions"], | ||
"title": "Changelog" | ||
}, | ||
"Notes": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"fixed": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/Fixed" | ||
} | ||
}, | ||
"knownIssues": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/Fixed" | ||
} | ||
}, | ||
"new": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/Fixed" | ||
} | ||
} | ||
}, | ||
"required": ["fixed", "knownIssues", "new"], | ||
"title": "Notes" | ||
}, | ||
"Fixed": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"note": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": ["note"], | ||
"title": "Fixed" | ||
}, | ||
"Version": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"artwork": { | ||
"type": "string" | ||
}, | ||
"importantNotes": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"phase": { | ||
"type": "string" | ||
}, | ||
"releaseDate": { | ||
"type": "string" | ||
}, | ||
"version": { | ||
"type": "string" | ||
}, | ||
"notes": { | ||
"$ref": "#/definitions/Notes" | ||
} | ||
}, | ||
"required": ["releaseDate", "version"], | ||
"title": "Version" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* eslint-disable no-await-in-loop */ | ||
import log from '../log'; | ||
import { getPlaylistData, setPlaylistData } from '../filesystem'; | ||
|
||
export default async (playlistId: string, newName: string) => { | ||
const playlists = getPlaylistData(); | ||
|
||
for (let i = 0; i < playlists.length; i += 1) { | ||
if (playlistId === playlists[i].playlistId) { | ||
playlists[i].name = newName; | ||
setPlaylistData(playlists); | ||
return log( | ||
'Playlist renamed successfully.', | ||
{ playlistId, newName }, | ||
'INFO', | ||
{ | ||
sendToRenderer: 'SUCCESS', | ||
}, | ||
); | ||
} | ||
} | ||
return log('Playlist not found.', { playlistId, newName }, 'WARN', { | ||
sendToRenderer: 'FAILURE', | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import path from 'path'; | ||
import fs from 'fs/promises'; | ||
|
||
import log from '../log'; | ||
import { getUserData } from '../filesystem'; | ||
|
||
const convertLyricsToLrcFormat = (songLyrics: SongLyrics) => { | ||
// const { title, lyrics } = songLyrics; | ||
// const output: string[] = []; | ||
|
||
// output.push(`[ti:${title}]`); | ||
// output.push(`[length:${min}:${sec}]`); | ||
|
||
// if (artists && artists?.length > 0) | ||
// metadataLines.push(`[ar:${artists.map((x) => x.name).join(', ')}]`); | ||
// if (album) metadataLines.push(`[al:${album.name}]`); | ||
// metadataLines.push(''); | ||
|
||
// const unparsedLines = lyrics.unparsedLyrics.split('\n'); | ||
// output.push(...unparsedLines); | ||
|
||
return songLyrics.lyrics.unparsedLyrics; | ||
}; | ||
|
||
const getLrcFileSaveDirectory = ( | ||
songPathWithoutProtocol: string, | ||
lrcFileName: string, | ||
) => { | ||
const userData = getUserData(); | ||
let saveDirectory: string; | ||
|
||
if (userData.customLrcFilesSaveLocation) | ||
saveDirectory = userData.customLrcFilesSaveLocation; | ||
else { | ||
const songContainingFolderPath = path.dirname(songPathWithoutProtocol); | ||
saveDirectory = songContainingFolderPath; | ||
} | ||
|
||
return path.join(saveDirectory, `${lrcFileName}.lrc`); | ||
}; | ||
|
||
const saveLyricsToLRCFile = async ( | ||
songPathWithoutProtocol: string, | ||
songLyrics: SongLyrics, | ||
) => { | ||
const songFileName = path.basename(songPathWithoutProtocol); | ||
const lrcFilePath = getLrcFileSaveDirectory( | ||
songPathWithoutProtocol, | ||
songFileName, | ||
); | ||
|
||
const lrcFormattedLyrics = convertLyricsToLrcFormat(songLyrics); | ||
|
||
await fs.writeFile(lrcFilePath, lrcFormattedLyrics); | ||
log(`Lyrics saved in ${lrcFilePath}.`, { title: songLyrics.title }); | ||
}; | ||
|
||
export default saveLyricsToLRCFile; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.