🚑 Fix UUID by using crypto
This commit is contained in:
13
src/tools/migrate.ts
Normal file
13
src/tools/migrate.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Config } from './types';
|
||||
|
||||
export function migrateToIdConfig(config: Config): Config {
|
||||
// Set the config and add an ID to all the services that don't have one
|
||||
const services = config.services.map((service) => ({
|
||||
...service,
|
||||
id: service.id ?? crypto.randomUUID(),
|
||||
}));
|
||||
return {
|
||||
...config,
|
||||
services,
|
||||
};
|
||||
}
|
||||
@@ -29,7 +29,7 @@ export type ServiceType =
|
||||
| 'Emby';
|
||||
|
||||
export interface serviceItem {
|
||||
id: number;
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
url: string;
|
||||
|
||||
Reference in New Issue
Block a user