Skip to content

Commit 3ce754b

Browse files
committed
Improved summary updates for completed videos
1 parent 1dc6a65 commit 3ce754b

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/Downloader.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ const getDownloadSempahore = async () => {
4343

4444
const releaseDownloadSemaphore = () => {
4545
AvalibleDeliverySlots++;
46-
completedVideos++;
4746

4847
// If there are queued requests, resolve the first one in the queue
4948
DownloadQueue.shift()?.();
@@ -144,7 +143,6 @@ const processVideo = async (fTitle: string, video: Video, retries = 0) => {
144143
summaryStats._.downloadedMB = summaryStats[fTitle].downloadedMB;
145144
summaryStats._.totalMB = summaryStats[fTitle].totalMB;
146145
delete summaryStats[fTitle];
147-
updateSummaryBar();
148146
}
149147
// eslint-disable-next-line no-fallthrough
150148
case VideoState.Partial: {
@@ -165,13 +163,13 @@ const processVideo = async (fTitle: string, video: Video, retries = 0) => {
165163
await (await (await (await (await plexApi.resource(sectionToUpdate.server)).connect()).library()).section(sectionToUpdate.section)).refresh();
166164
}
167165
}
168-
updateSummaryBar();
169166
}
170167
// eslint-disable-next-line no-fallthrough
171168
case VideoState.Muxed: {
169+
completedVideos++;
170+
updateSummaryBar();
172171
mpb?.done(fTitle);
173172
setTimeout(() => mpb?.removeTask(fTitle), 10000 + Math.floor(Math.random() * 6000));
174-
updateSummaryBar();
175173
}
176174
}
177175
} catch (error) {

0 commit comments

Comments
 (0)