Skip to content

Commit 66c266d

Browse files
committed
fix: fetch spicetify/modules vault.json
1 parent b336870 commit 66c266d

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

module.ts

+17-8
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export abstract class Module<
6666
public parent: Module<Module<C, I>> | null,
6767
protected children: Record<ModuleIdentifier, C>,
6868
private identifier: ModuleIdentifier,
69-
) { }
69+
) {}
7070

7171
public getIdentifier(): ModuleIdentifier {
7272
return this.identifier;
@@ -125,7 +125,6 @@ export abstract class Module<
125125

126126
public abstract newInstance(version: Truthy<Version>, store: _Store): Promise<I>;
127127

128-
129128
public async init(versions: _Module["v"]) {
130129
await Promise.all(
131130
Object.entries(versions)
@@ -181,7 +180,12 @@ export class RemoteModule extends Module<RemoteModule, RemoteModuleInstance> {
181180
}
182181

183182
export class LocalModule extends Module<RemoteModule, LocalModuleInstance> {
184-
constructor(parent: RootModule, children: Record<ModuleIdentifier, RemoteModule>, identifier: ModuleIdentifier, public enabled: Version) {
183+
constructor(
184+
parent: RootModule,
185+
children: Record<ModuleIdentifier, RemoteModule>,
186+
identifier: ModuleIdentifier,
187+
public enabled: Version,
188+
) {
185189
super(parent, children, identifier);
186190
}
187191

@@ -203,7 +207,8 @@ export class LocalModule extends Module<RemoteModule, LocalModuleInstance> {
203207

204208
public canEnable(instance: LocalModuleInstance) {
205209
const enabledInstance = this.getEnabledInstance();
206-
return !instance.isEnabled() && instance.isInstalled() && (!enabledInstance || this.canDisable(enabledInstance));
210+
return !instance.isEnabled() && instance.isInstalled() &&
211+
(!enabledInstance || this.canDisable(enabledInstance));
207212
}
208213

209214
public enable(instance: LocalModuleInstance) {
@@ -248,7 +253,6 @@ export class LocalModule extends Module<RemoteModule, LocalModuleInstance> {
248253
public getEnabledInstance(): LocalModuleInstance | undefined {
249254
return this.getEnabledVersion() ? this.instances.get(this.getEnabledVersion()!)! : undefined;
250255
}
251-
252256
}
253257

254258
export interface MixinLoader {
@@ -295,7 +299,7 @@ export abstract class ModuleInstance<M extends Module<any> = Module<any>> {
295299
public metadata: Metadata | null,
296300
public artifacts: Array<string>,
297301
public checksum: string,
298-
) { }
302+
) {}
299303

300304
// ?
301305
public updateMetadata(metadata: Metadata) {
@@ -702,7 +706,12 @@ export const INTERNAL_TRANSFORMER = createTransformer(INTERNAL_MIXIN_LOADER);
702706

703707
const vaults = [
704708
await fetchJson<_Vault>("/modules/vault.json"),
705-
await fetchJson<_Vault>("https://raw.githubusercontent.com/spicetify/pkgs/main/vault.json")
709+
await fetchJson<_Vault>("https://raw.githubusercontent.com/spicetify/modules/main/vault.json"),
710+
await fetchJson<_Vault>("https://raw.githubusercontent.com/spicetify/pkgs/main/vault.json"),
706711
];
707712
const provider = vaults.reduce<_Vault["modules"]>((acc, vault) => deepMerge(acc, vault.modules), {});
708-
await Promise.all(Object.keys(provider).map(async (identifier) => RootModule.INSTANCE.newChild(identifier, provider[identifier])));
713+
await Promise.all(
714+
Object.keys(provider).map(async (identifier) =>
715+
RootModule.INSTANCE.newChild(identifier, provider[identifier])
716+
),
717+
);

0 commit comments

Comments
 (0)