Skip to content

Commit

Permalink
Make considerAllNonPartialDownloaded update attachment database bytes…
Browse files Browse the repository at this point in the history
…izes
  • Loading branch information
Inrixia committed Apr 26, 2023
1 parent 4386c34 commit f6feb07
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/Video.ts
Expand Up @@ -141,15 +141,15 @@ export class Video {
}

public async getState() {
const { muxedSize, partialSize } = await this.attrStore();
const attrStore = await this.attrStore();

const muxedBytes = await Video.pathBytes(this.muxedPath);
// If considerAllNonPartialDownloaded is true, return true if the file exists. Otherwise check if the file is the correct size
if (settings.extras.considerAllNonPartialDownloaded && muxedBytes !== -1) return true;
if (muxedSize === muxedBytes) return VideoState.Muxed;
if (settings.extras.considerAllNonPartialDownloaded && muxedBytes !== -1) attrStore.muxedSize = muxedBytes;
if (attrStore.muxedSize === muxedBytes) return VideoState.Muxed;

const partialBytes = await Video.pathBytes(this.partialPath);
if (partialSize === partialBytes) return VideoState.Partial;
if (attrStore.partialSize === partialBytes) return VideoState.Partial;

return VideoState.Missing;
}
Expand Down

0 comments on commit f6feb07

Please sign in to comment.