mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-11 22:29:38 +00:00
Add download location settings
This commit is contained in:
@@ -1,20 +1,11 @@
|
||||
import { randomBytes } from 'crypto'
|
||||
import { basename, parse } from 'path'
|
||||
import { parse } from 'path'
|
||||
import sanitize from 'sanitize-filename'
|
||||
import { inspect } from 'util'
|
||||
|
||||
import { lower } from '../src-shared/UtilFunctions.js'
|
||||
import { settings } from './ipc/SettingsHandler.ipc.js'
|
||||
import { emitIpcEvent } from './main.js'
|
||||
|
||||
/**
|
||||
* @returns The relative filepath from the library folder to `absoluteFilepath`.
|
||||
*/
|
||||
export async function getRelativeFilepath(absoluteFilepath: string) {
|
||||
if (!settings.libraryPath) { throw 'getRelativeFilepath() failed; libraryPath is undefined' }
|
||||
return basename(settings.libraryPath) + absoluteFilepath.substring(settings.libraryPath.length)
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns `true` if `name` has a valid video file extension.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user