iam4x / bobarr

🍿 The all-in-one alternative for Sonarr, Radarr, Jackett... with a VPN and running in docker
MIT License
1.53k stars 88 forks source link

Missing season torrent will block the rename and link, for single episode #153

Closed nch3ng closed 3 years ago

nch3ng commented 4 years ago

When I search and download a season, and the system found a wrong season (or another tv show). therefore I decided to replace one by one, and remove the wrong full season downloading in transmission.

The system will throw error at

const isComplete = transmissionTorrent.percentDone === 1;

in refresh-torrent.processor.ts

Cannot read property 'percentDone' of undefined

Because there's no season torrent exists in transmission client, thus transmissionTorrent is undefined, and rest of the process will break.

I think it needs to check the object before getting percentDone, or any suggestion? I'm trying to learn the code from today, see if I can help in the feature.

I temporarily add const isComplete = !! transmissionTorrent && transmissionTorrent.percentDone === 1; to by pass it.

iam4x commented 3 years ago

Hey @qqnc that is a pretty good fix, can you open a PR and then I will be happy to do a code review and help you out 👍

iam4x commented 3 years ago

And this is linked to #50 because bobarr is downloading a season pack but it can't allow to select another season pack or to stop the download.

nch3ng commented 3 years ago

thanks, haven't checked this for quite a while