Skip to content

Commit

Permalink
Merge pull request #277 from vitalygashkov/next
Browse files Browse the repository at this point in the history
Fixed downloading multiple audio tracks with same language, but different labels; added audio label output when selecting tracks
  • Loading branch information
vitalygashkov authored Dec 17, 2024
2 parents 9a8aa88 + 0d12a53 commit c820e6d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/cli
Submodule cli updated from b34b02 to 2d60ab
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions packages/core/lib/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class LocalStorage implements Storage {
}

save() {
logger.debug(`Saving localStorage state to ${this.filePath}`);
writeFileSync(this.filePath, this.stringify());
}
}
Expand Down Expand Up @@ -139,6 +140,9 @@ export const createStorage = async (name: string) => {
return obj;
};

const localStorage = new LocalStorage(storagePath);
await localStorage.load();

const storage: Record<string, any> = {
async load() {
const data = (await fs.readJson<any>(storagePath).catch(() => {})) || {};
Expand Down Expand Up @@ -171,16 +175,14 @@ export const createStorage = async (name: string) => {
return serializable(storage);
},
async save(items?: Record<string, any>) {
exitQueue.length = 0;
clear(storage);
const data = items || serializable(storage);
for (const [key, value] of Object.entries(data)) storage[key] = value;
await fs.writeJson(storagePath, data);
},
};

const localStorage = new LocalStorage(storagePath);
await localStorage.load();

return { storage, localStorage };
};

Expand All @@ -199,8 +201,9 @@ export const createStore = (name: string) => {
return state as T;
};
const setState = async <T = Record<string, any>>(data?: T) => {
exitQueue.length = 0;
Object.assign(state, data || {});
logger.debug(`Saving state...`);
logger.debug(`Saving state to ${storePath}`);
logger.debug(data || state);
await fs.writeJson(storePath, data || state);
};
Expand Down
2 changes: 1 addition & 1 deletion packages/dasha
Submodule dasha updated 1 files
+2 −2 lib/track.js

0 comments on commit c820e6d

Please sign in to comment.