Skip to content

Commit

Permalink
video: Fix method for discarding unprocessed data
Browse files Browse the repository at this point in the history
It was not working, as it was trying to remove a file with the name of the hash, and not files that included the hash.
  • Loading branch information
rafaellehmkuhl committed Feb 3, 2025
1 parent 60f8eb4 commit 53aafb7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/stores/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,12 @@ export const useVideoStore = defineStore('video', () => {
}

const discardUnprocessedFilesFromVideoDB = async (hashes: string[]): Promise<void> => {
const allKeys = await tempVideoStorage.keys()
for (const hash of hashes) {
await tempVideoStorage.removeItem(hash)
const keysToRemove = allKeys.filter((key) => key.includes(hash))
for (const key of keysToRemove) {
await tempVideoStorage.removeItem(key)
}
delete unprocessedVideos.value[hash]
}
}
Expand Down

0 comments on commit 53aafb7

Please sign in to comment.