Skip to content

Commit

Permalink
Improved summary updates for completed videos
Browse files Browse the repository at this point in the history
  • Loading branch information
Inrixia committed Jun 28, 2023
1 parent 1dc6a65 commit 3ce754b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const getDownloadSempahore = async () => {

const releaseDownloadSemaphore = () => {
AvalibleDeliverySlots++;
completedVideos++;

// If there are queued requests, resolve the first one in the queue
DownloadQueue.shift()?.();
Expand Down Expand Up @@ -144,7 +143,6 @@ const processVideo = async (fTitle: string, video: Video, retries = 0) => {
summaryStats._.downloadedMB = summaryStats[fTitle].downloadedMB;
summaryStats._.totalMB = summaryStats[fTitle].totalMB;
delete summaryStats[fTitle];
updateSummaryBar();
}
// eslint-disable-next-line no-fallthrough
case VideoState.Partial: {
Expand All @@ -165,13 +163,13 @@ const processVideo = async (fTitle: string, video: Video, retries = 0) => {
await (await (await (await (await plexApi.resource(sectionToUpdate.server)).connect()).library()).section(sectionToUpdate.section)).refresh();
}
}
updateSummaryBar();
}
// eslint-disable-next-line no-fallthrough
case VideoState.Muxed: {
completedVideos++;
updateSummaryBar();
mpb?.done(fTitle);
setTimeout(() => mpb?.removeTask(fTitle), 10000 + Math.floor(Math.random() * 6000));
updateSummaryBar();
}
}
} catch (error) {
Expand Down

0 comments on commit 3ce754b

Please sign in to comment.