mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-11 14:19:38 +00:00
Fix downloads
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import _ from 'lodash'
|
||||
import sanitize from 'sanitize-filename'
|
||||
import { Difficulty, Instrument } from 'scan-chart'
|
||||
|
||||
import { ChartData } from './interfaces/search.interface'
|
||||
@@ -24,29 +23,6 @@ export function driveLink(fileId: string) {
|
||||
return `https://drive.google.com/open?id=${fileId}`
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns `filename` with all invalid filename characters replaced.
|
||||
*/
|
||||
export function sanitizeFilename(filename: string): string {
|
||||
const newFilename = sanitize(filename, {
|
||||
replacement: ((invalidChar: string) => {
|
||||
switch (invalidChar) {
|
||||
case '<': return '❮'
|
||||
case '>': return '❯'
|
||||
case ':': return '꞉'
|
||||
case '"': return "'"
|
||||
case '/': return '/'
|
||||
case '\\': return '⧵'
|
||||
case '|': return '⏐'
|
||||
case '?': return '?'
|
||||
case '*': return '⁎'
|
||||
default: return '_'
|
||||
}
|
||||
}),
|
||||
})
|
||||
return (newFilename === '' ? 'TODO_MAKE_UNIQUE' : newFilename)
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns `text` converted to lower case.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user