import { basename , parse } from 'path' ; import { getSettingsHandler } from '../ipc/SettingsHandler.ipc' ; import { emitIPCEvent } from '../main' ; import { lower } from './UtilFunctions' ; returns export function getRelativeFilepath ( absoluteFilepath ) { const settings = getSettingsHandler . getSettings ( ) ; return basename ( settings . libraryPath ) + absoluteFilepath . substring ( settings . libraryPath . length ) ; } returns export function hasVideoExtension ( name ) { return ( [ '.mp4' , '.avi' , '.webm' , '.ogv' , '.mpeg' ] . includes ( parse ( lower ( name ) ) . ext ) ) ; } /**
 * Log a message in the main BrowserWindow's console.
 * Note: Error objects can't be serialized by this; use serializeError(err) before passing it here.
 */ export function devLog ( ... messages ) { emitIPCEvent ( 'log' , messages ) ; }