Ability to Import a sequentially downloading torrent into the Library

Say you have an internet connection that goes about 1mb/s.
You get a notification that your episode was just found from an indexer.
Since your DL Speed is relatively slow you’d rather not wait the two hours to begin a ~10gb Movie or Show.

One habit that I’ve gotten into is sequentially downloading the torrent and playing it as if it were a stream. Eliminating the need to wait.

I can imagine a way in which Sonarr could get the remaining download time of a torrent, determine it’s playability from reading whether the beginning pieces have completed, it’s sequential status, and finally, ffmpeg could be used to get the media file’s actual duration to determine if it’s ready to play without interruption.

Using that data, it’d be nice to have Sonarr Automatically import the torrent into the Library and alert whatever various connections the use has setup that the media is ready to play. Like, Emby or Kodi.

I noticed that Sonarr uses Hardlinks when importing to the library and from my own testing, the target and the original files’ bytes are manipulated synchronously. So there shouldn’t be any problems with reading unless one were to manipulate the hardlink after it’s creation.
In my experience, any attempt to rename – after hardlink creation – while the download client is still writing; it will shoot back a “This file is open in another program” error.
But I’m sure Sonnar could restrict the user from manipulating the corresponding library item until it’s finished.

I think this should be possible?

if your internet downloads are that slow the playback is obviously going to stop until it can buffer and then stop and buffer and stop and buffer. are you really going to watch it like that?

but lets say you have just the right amount of speed and it wont stutter - why not just play it from the download folder its currently downloading to? you dont have to wait for sonarr to finish. sonarr is just file management. playback is up to you.

all up your talking about an edge use case that is so small its not really worth bothering with.

only if your system is setup so that hard links will work - ie they (the download folder and the series root folder) must be local, and must have a common ancestor path

and what happens when my download stalls and sonarr finds another one and starts downloading that?

The intention of the program would be monitor the download speed, in conjunction with ffprobing for the duration, to determine the optimal time when that DOES NOT happen. It could turn waiting two hours into waiting just ten to thirty minutes.

Then increase the variables the use case so it’s not so small. A Blueray Remux at ~60gb and a connection of ~10mb/s. That’s a wait time around 1h 40m. Short enough for the average movie to be imported to the library immediately. Even then, with a connection of 8mb/s you could download for just 30 min and then it’d be playable.

Welp, mine is. As for more complex setups, that’s unfortunate. A come on, in the userbase, is running sonnar on a remote machine really more common than using the same machine. I’m sure the average user is on some sort of singular NAS where this isn’t a problem.
And who’s to say you couldn’t have the player target two directories, one on the local server (used specifically for streaming) and another on the remote (for completed files)? Just have Sonarr move the file once the read/write lock is released to the remote server.

The point of this idea would be to generate a True/False statement. If the conditions are such that it returns false; the library item wont be added since a stall wouldn’t generate a true statement. And if it stalled and picked another in the midst of a download, once a download is stopped the write lock is released on the file and it can be removed from the library.

As for playback yes it is up tp the user, as in Emby in my case. But like you said the file’s overall availability, in the library, to the player could be determined by sonarr much earlier compared to waiting for the ENTIRE download to complete.

Anywho I can see the logic in that this might be more complex than it’s worth.
I’m an amateur programmer. Maybe could I sit down and write a python plugin or something.
However, I’m not going to be as adept as any Sonarr developers. One thing for sure, they’d know where to start.
This potential feature seems powerful to me, if anyone has the heart and mind to see it through; it’d be best done by someone more experienced.

We do not have plans for this, you could use a script to hardlink the file into the library (Custom script in Sonarr reacting to the On Grab event perhaps).

Thanks for the Reply and the Tip! Might just be fun too.

so is mine. that wasnt the point.

im not even talking about those types of complex systems. lots of people just dont know, as they arent linux people with in-depth knowledge. they have things set up on completely different volumes (which is all you need to stop hard linking from working).

most of the docker instructions dont really help here (because they dont care about hard linking, just visual simplicity) and add to the confusion. thats for people running a completely basic setup on a single nas.

it doesnt even begin to get complex yet people dont set it up optimally, but sonarr doesnt really care and just chugs along fine because its designed to be simplistic.

edge case as in the number of users that would use this functionality vs the complexity it would add to the code, would be exceedingly low - not anything to do with having the “right” amount of bandwidth for it to work.

you really cant see youre just adding a whole bunch of complexity for no real added value?

sonarr isnt designed to be a streaming service. its designed to be set and forget, watch it later.

if you want to watch it right now then play it from the download location if your setup is that simple, or do what marcus suggested (although im not sure if you can generate the correct filename, or if its available as an environment variable to use)

I respectfully disagree. There is real added value. The way that I know is from my own experience. I used to have some powershell jiggery that did just what I described, but it was in a haphazard manner. Additionally, I got it working across hdds with some byte streaming. Fortunately, powershell and qbit makes that very easy. (I’m sure it’s wayyyyy more difficult elsewhere. Humble truth) Anyways, It was convenient, fast and somewhat reliable. Not to mention dynamic in terms of carrying it around to multiple network environments.

As an aside,
I personally dislike whatever attitude that is averse to this sort of complexity. Honestly, this seems like an absolute no-brainer to me. Luckily, the world can function with both attitudes living separately. It’s just like rubbing sand paper posing ideas with others sometimes. Yeesh. Makes me want to forget about even posting.

I now understand this goes against the general philosophy of Sonarr. I see the reality there are too many moving parts. I have been chasten good sir, rhom. I humbly beg your everlasting forgiveness and hope I could some day be seen as virtuous in your eyes.

XD Joking aside,
I’m willing to put in some time to try out a script for my use case. Perhaps in a while, you could try it and see it’s convivence and value. But don’t hold your breath, b/c again, I’m just a tweaker and this may never see the light of day in my hands.

thats fine, and im sure there is value for you. but you do have to realise that you are solely going off your own personal experiences - so its an edge case - you have to work out how many users would actually want this, and also want sonarr to do it, to see if there is real value for others

if you can show there is a massive user base out there that would use this functionality then thats fine, until then though, its just something you think is cool. been there done that. not all ideas we think are cool, actually are, or are just too complex, conflict with existing stuff, or not worth the time to implement because there are things with higher priority (that are valued).

again, your opinion, thats fine. im not averse to complexity but only where its absolutely needed - and i recognise that the more complex something is the more likely theres going to be bugs/issues with it, and that its going to make maintenance that much harder later on.

sonarr is open source, you are free to fork it or write your own code for this feature and submit it if you feel it is such a no brainer.

if i were you id probably ask around to see what the numbers are like for people that would use a feature like that before starting though.

if you cant take civil criticism of your ideas, then maybe you shouldnt post them on any public forum. be an adult, realise theres lots of opinions out there, you may be wrong, i may be wrong, we both could be, that doesnt mean we chuck out the toy and run home to mommy at the first “sorry i dont think its a good idea” post.

i know you think youre joking but it just shows the wrong attitude. im not a dev, im just a user pointing out that what youre suggesting is probably an edge case (not enough users would want it), that the devs will either outright say no to, or if agreeable would place right at the bottom of the pile of features for investigation.

i would suggest skipping the sarcasm and actually provide reasons why large numbers of users would use this neat new feature youre wanting added, get people to reply that they too think its neat and would want it implemented, so that the devs might accept it and give it a higher priority.

expect people to reply that they do not like your idea and do not want it implemented, or just think its not worth the devs time, and other various reasons. dont use sarcasm back at them, dont attempt to make them look stupid. just accept their input and move on.

sorry, my usage of sonarr wouldnt ever make this viable. i typically watch them after the season has completed, except for the ones i really like which i watch later that day (the upside of being in a different timezone than most of them are broadcast on), or on the weekends.

i think theres only been one time i really wanted to check out a download before it had finished, both in excitement and needing confirmation it was real, i just played it from the download location. should also note that is was a movie, so radarr, not sonarr.

i dont need anything fancy to make that work on the very rare occasions that i would want to do this.

2 Likes