Download Manager Requeue Movies upon connection restoration for Offline

Hi there,

Been really enjoying my time with Yatse. I’m using it to connect to my Jellyfin server and the Smart Downloads feature for lengthy series has been awesome to sync the next few episodes offline and track progress through the series as I view them offline.

One thing I noticed that’s a little… less congruent, is downloading from my Movies library. To preface: I’m deployed in Iraq. We have terrible, unreliable haji internet here. Which is why I have to download everything before viewing.
In the case of the Movies library, if I select a bunch of movies and click “Change Offline State”, I see them get queued up in the Download Queue as expected.
However, with the internet here, sometimes the downloads take hours, and there are frequent disconnects… So, I’ve noticed that if there’s even a hitch or slight disconnection during the download process, the download aborts, and NEVER attempts to resume where it left off in the download or even start from scratch. Even going to the failed download in the Download Queue and pressing Resume does not cause it to maintain/resume progress from when it lost connection.

This may be a minor issue/niche use case, but I’d really like if this functioned more similarly to the TV Series download queue and resume once reconnected. Previously I was using ADM to download from my server, and it would resume the download progress once the internet is reconnected, but I’ve been enjoying the Yatse experience and would ideally like to just see Yatse behave similarly, seeing as it does so already for the TV Series, and keep it all in one app. :slight_smile:

Thank you for your hard work and support! Hopefully this is a reasonable description of the issue I’m facing.

It should already work like that, please provide logs reproducing this.

Sure thing!

I started downloading again and let it run as I normally do. It took some time as usual, but it did eventually hit this stuck status where I can’t get anything to resume and would have to manually select and Requeue them (from the Movies library screen) for them to start, though they do still show in the Queue.

(The .zip it gave me was too large to upload, so below is the Drive link for it)

There’s a ton of sync in those logs and each time it queues the tv episodes.

From the logs the movie works, then is stopped then properly resume then fail again but since shows where queued it now start to sync the shows and will only return to movie when it’s done.

I know… and I’m sorry. I saw how big that file was and realized there would be a lot of “noise” in those logs…

So, I started the syncing manually again. This time, I did see what you were saying that it would finish off the TV episodes. However, after I checked on it a few times, I began to wonder… so I turned debug mode back on.

What happened was that it did indeed finish downloading the missing episodes, but then never resumed downloading the incomplete movies, and I captured that behavior in the debug mode for sure this time. I tried refreshing the library, even restarted my phone, but the movies never attempted to resume again. I hope this is what we’re looking for!

debug-20240425_202144.zip (7.8 MB)

I do not see any attempt to download the movie.

But after reading again your description, the issue is that there’s only a number of attempts to download the movie then it requires that you manually resume the media for it to start again.

There’s automatic delays between the retries in case of errors.

I can’t just try for ever else it would just kill the battery for no reason.

Ah, I see… so it did just completely stop attempting. Yeah it certainly makes sense that it can’t just poll continuously forever or it’d kill the battery very quickly haha.

I expected since the TV series would resume but the movies would not, there must be some difference between the way each are handled. Like maybe waiting for the next library refresh before attempting again after X timeouts, or it would have the TV show/movie flagged and stored somewhere in the app as “Make available offline”, similar to how Google Drive or OneDrive works, which might re-attempt the download on WiFi re-connection or a library refresh.

Are there possible solutions I can do to have it retry? My issue isn’t so much the extra step, but that in some cases it might download a 4GB movie to 99% (which takes forever out here due to the internet), and then lose all that progress, restarting from 0%, the next time I manually re-queue it for a download. So it’s like it can end up in this never-ending cycle of not being able to completely download.

ADM/1DM have some method of keeping/caching the file download progress between lengthy periods of disconects, I just want to support Yatse as I prefer Yatse for virtually every other reason besides this weird download case I’ve encountered lol…

Movies does resume if you press resume from the download queue.

And then it tries again the number of tries.

You should not requeue the movie.

If the app is killed in the background you can access the queue from manage offline media / Files then 3 dots download queue.

I’d definitely prefer if they would just resume, but that’s not the behavior I’m seeing, so I have previously tried re-queueing them as a last resort.

I just tried Resuming from the Download Queue, but as you can see in the screen capture, even though it shows the movies in the queue, it does not resume them. I tried individually clicking on them as well as pressing “Resume all” from the top, both ways causes the Download Manager notification to process for a few moments, and then says “Inactive”.

debug-20240426_144850.zip (16.2 KB)

Hum that’s strange there’s nothing in the logs.

I’ll need to try to reach that state :frowning:

Just to be sure, can you try to reboot the phone ?

Sorry for the delay. I did a reboot of my phone and there were a few new unwatched episodes of a show that it needed to sync, so I waited for those to finish before replying.

After those were done downloading, it ended up in the same state with the movies not re-attempting or being able to resume manually from the Download Queue.

Ok so took me a while to understand your issue.

The problem is that you keep syncing the database and so the ids changes and so the resume did not work because it could not found the item again.

If you stop syncing non stop resume should work, I’ll fix next release to not depend on the unstable id but on the stable ones.

Ohh I see… I do have the “auto refresh library” setting on as well… so I’ll start by turning that off for sure. That makes sense actually because I was letting it run for several hours, but then would open the app to check on the Download Queue status/progress, and I think that would cause an automatic refresh.

Thank you very much for looking into this! I’ll tweak that setting and wait for the next update. :blush:

You’ll still probably have to press resume if the app is killed and when you reach the max attempts but it should work.

That works for me!

At least I’d be out of the never-ending loop due to the terrible Internet here haha.

Thank you again :pray: