mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-07-07 10:35:09 +00:00
Add "Tools" tab with chart issue scanner
This commit is contained in:
@@ -23,19 +23,21 @@ export const themes = [
|
||||
* Represents Bridge's user settings.
|
||||
*/
|
||||
export interface Settings {
|
||||
downloadVideos: boolean // If background videos should be downloaded
|
||||
theme: typeof themes[number] // The name of the currently enabled UI theme
|
||||
customTheme: ThemeColors | null // The colors of a custom theme
|
||||
customThemePath: string | null // The last folder that contained the `customTheme`'s file
|
||||
libraryPath: string | undefined // The path to the user's library
|
||||
chartFolderName: string // The relative path and name of the chart that is saved in `libraryPath`
|
||||
isSng: boolean // If the chart should be downloaded as a .sng file or as a chart folder
|
||||
isCompactTable: boolean // If the search result table should have reduced padding
|
||||
visibleColumns: string[] // The search result columns to include
|
||||
zoomFactor: number // How much the display should be zoomed
|
||||
instrument: Instrument | null // The instrument selected by default, or `null` for "Any Instrument"
|
||||
difficulty: Difficulty | null // The difficulty selected by default, or `null` for "Any Difficulty"
|
||||
volume: number // The volume of the chart preview (0-100)
|
||||
downloadVideos: boolean // If background videos should be downloaded
|
||||
theme: typeof themes[number] // The name of the currently enabled UI theme
|
||||
customTheme: ThemeColors | null // The colors of a custom theme
|
||||
customThemePath: string | null // The last folder that contained the `customTheme`'s file
|
||||
libraryPath: string | undefined // The path to the user's library
|
||||
issueScanPath: string | undefined // The path to use when scanning for issues
|
||||
spreadsheetOutputPath: string | undefined // The path to use when saving generated issues
|
||||
chartFolderName: string // The relative path and name of the chart that is saved in `libraryPath`
|
||||
isSng: boolean // If the chart should be downloaded as a .sng file or as a chart folder
|
||||
isCompactTable: boolean // If the search result table should have reduced padding
|
||||
visibleColumns: string[] // The search result columns to include
|
||||
zoomFactor: number // How much the display should be zoomed
|
||||
instrument: Instrument | null // The instrument selected by default, or `null` for "Any Instrument"
|
||||
difficulty: Difficulty | null // The difficulty selected by default, or `null` for "Any Difficulty"
|
||||
volume: number // The volume of the chart preview (0-100)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,6 +49,8 @@ export const defaultSettings: Settings = {
|
||||
customTheme: null,
|
||||
customThemePath: null,
|
||||
libraryPath: undefined,
|
||||
issueScanPath: undefined,
|
||||
spreadsheetOutputPath: undefined,
|
||||
chartFolderName: '{artist} - {name} ({charter})',
|
||||
isSng: false,
|
||||
isCompactTable: false,
|
||||
|
||||
@@ -207,6 +207,27 @@ export function hasChartExtension(fileName: string) {
|
||||
return ['chart', 'mid'].includes(getExtension(fileName).toLowerCase())
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns `true` if `fileName` is a valid album fileName.
|
||||
*/
|
||||
export function hasAlbumName(fileName: string) {
|
||||
return ['album.jpg', 'album.jpeg', 'album.png'].includes(fileName)
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns `true` if `name` has a valid sng file extension.
|
||||
*/
|
||||
export function hasSngExtension(name: string) {
|
||||
return 'sng' === getExtension(name).toLowerCase()
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns `true` if `fileName` has a valid ini file extension.
|
||||
*/
|
||||
export function hasIniExtension(fileName: string) {
|
||||
return 'ini' === getExtension(fileName).toLowerCase()
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns `true` if `fileName` is a valid chart fileName.
|
||||
*/
|
||||
@@ -246,6 +267,16 @@ export function hasAudioName(fileName: string) {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns true if the list of filename `extensions` appears to be intended as a chart folder.
|
||||
*/
|
||||
export function appearsToBeChartFolder(extensions: string[]) {
|
||||
const ext = extensions.map(extension => extension.toLowerCase())
|
||||
const containsNotes = ext.includes('chart') || ext.includes('mid')
|
||||
const containsAudio = ext.includes('ogg') || ext.includes('mp3') || ext.includes('wav') || ext.includes('opus')
|
||||
return containsNotes || containsAudio
|
||||
}
|
||||
|
||||
export function resolveChartFolderName(
|
||||
chartFolderName: string,
|
||||
chart: { name: string; artist: string; album: string; genre: string; year: string; charter: string },
|
||||
|
||||
@@ -74,6 +74,7 @@ export interface IpcToMainEmitEvents {
|
||||
quit: void
|
||||
showFolder: string
|
||||
showFile: string
|
||||
scanIssues: void
|
||||
}
|
||||
|
||||
export type IpcToMainEmitHandlers = {
|
||||
@@ -93,6 +94,7 @@ export interface IpcFromMainEmitEvents {
|
||||
queueUpdated: number[]
|
||||
maximized: void
|
||||
minimized: void
|
||||
updateIssueScan: { status: 'progress' | 'error' | 'done'; message: string }
|
||||
}
|
||||
|
||||
export type IpcFromMainEmitHandlers = {
|
||||
|
||||
Reference in New Issue
Block a user