-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaned up deps, added the dep viewer, updated js dependencies
- Loading branch information
Kevin Frei
committed
Jun 25, 2024
1 parent
a4e73a3
commit 1520776
Showing
22 changed files
with
2,368 additions
and
1,438 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,3 +39,4 @@ dist-electron | |
shared/build | ||
modules/*/lib | ||
.nx | ||
*-deps.svg |
434 changes: 217 additions & 217 deletions
434
.yarn/releases/yarn-4.3.0.cjs → .yarn/releases/yarn-4.3.1.cjs
Large diffs are not rendered by default.
Oops, something went wrong.
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,48 @@ | ||
import { Comms, Persistence } from '@freik/electron-main'; | ||
import { MakeLog } from '@freik/logger'; | ||
import { protocol } from 'electron'; | ||
import { UpdateAudioLocations } from './AudioDatabase'; | ||
import { PictureHandler } from './cover-art'; | ||
import { tuneNewProtocolHandler, tuneProtocolHandler } from './protocols'; | ||
|
||
const { log } = MakeLog('EMP:main:RegisterProtocols'); | ||
|
||
export function RegisterPrivileges(): void { | ||
protocol.registerSchemesAsPrivileged([ | ||
{ | ||
scheme: 'tune', | ||
privileges: { | ||
// secure: true, | ||
standard: true, | ||
supportFetchAPI: true, // Add this if you want to use fetch with this protocol. | ||
stream: true, // Add this if you intend to use the protocol for streaming i.e. in video/audio html tags. | ||
// corsEnabled: true, // Add this if you need to enable cors for this protocol. | ||
// bypassCSP: false | ||
}, | ||
}, | ||
]); | ||
} | ||
// This sets up all protocol handlers | ||
|
||
export function RegisterProtocols(): void { | ||
// TODO: Enable both song & album pictures | ||
// folder-level photos are fine, but for song requests, check the song | ||
// then fall back to the album | ||
log('Registering pic://key/ protocol'); | ||
protocol.handle('pic', PictureHandler); | ||
log('Registering tune://song/ protocol'); | ||
protocol.handle('tune', tuneNewProtocolHandler); | ||
Comms.registerOldProtocolHandler( | ||
'trune://song/', | ||
|
||
protocol.registerFileProtocol, | ||
tuneProtocolHandler, | ||
); | ||
log('Finished protocol registration'); | ||
} | ||
// This sets up reactive responses to changes, for example: | ||
// locations change, so music needs to be rescanned | ||
|
||
export function RegisterListeners(): void { | ||
Persistence.subscribe('locations', UpdateAudioLocations); | ||
} |
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,15 @@ | ||
import { Comms } from '@freik/electron-main'; | ||
import { IpcId } from '@freik/emp-shared'; | ||
import { MakeLog } from '@freik/logger'; | ||
|
||
const { log } = MakeLog('EMP:main:SendToUI'); | ||
|
||
// This is for one-way comms to the UI process | ||
|
||
export function SendToUI<T>(name: IpcId, data: T) { | ||
const obj: { [key: string]: T } = {}; | ||
obj[name] = data; | ||
log(`Sending ${name} with data:`); | ||
log(data); | ||
Comms.AsyncSend(obj); | ||
} |
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 @@ | ||
export type OnWindowCreated = () => Promise<void>; |
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
Oops, something went wrong.