Page 1 of 1

Why make sequential downloading and last piece options independet?

Posted: Wed Feb 03, 2016 10:04 am
by mo0n_snier
Hi,

My oppinion is that making "Download in sequential order" and "Download first and last piece first" options independent is not necessary.
"Download in sequential order" is used for watching a movie that is not downloaded and I find it to be a very nice and useful feature in qbittorrent.

So I sugest to make selecting "Download in sequential order" auto-selecting also "Download first and last piece first".
This behaviour was used before and I think it's better.

Re: Why make sequential downloading and last piece options independet?

Posted: Wed Feb 03, 2016 11:07 am
by FliessendWasser
It is optional because of the nature of BitTorrent.
Pieces are typically downloaded non-sequentially and are rearranged into the correct order by the BitTorrent Client, which monitors which pieces it needs, and which pieces it has and can upload to other peers.
...which basically means that downloading a torrent sequentially is per se against the rules of BitTorrent itself. Making it to the standard option means there would be a blockade in case the one seeder stops providing the pieces left for the download.

TL;DR: BitTorrent is based on an exchange of random pieces of a torrent. If this is not possible, the torrent is stuck. No exchange anymore. In that case, you could also stream the movie...

(Read this if you are interested in more: http://www.rasterbar.com/products/libto ... orrent.pdf -> specifically page 11 and 12 for the pieces question)

Re: Why make sequential downloading and last piece options independet?

Posted: Wed Feb 03, 2016 2:43 pm
by mo0n_snier
Yes, but I didn't said to make that the default behaviour.
What I mean is that when clicking "Download in sequential order" also "Download first and last piece first" to be automatically selected.

I was refering to this commit:
Make "Download in sequential order" and "Download first and last piece first" options independent. (glassez)

Re: Why make sequential downloading and last piece options independet?

Posted: Wed Feb 03, 2016 6:30 pm
by ciaobaby
What I mean is that when clicking "Download in sequential order" also "Download first and last piece first" to be automatically selected.
That is because, despite the two options being mutually exclusive technically the 'headers' and/or the 'seek index' for 'movie' file containers are not necessarily in the first piece of a file, they may well be in the last piece instead, or indeed as well. Also in the case of Matroska formats the headers can be in the middle segments.

BitTorrent is based on an exchange of random pieces of a torrent. If this is not possible, the torrent is stuck. No exchange anymore.
Not 'random' the default is to request the 'rarest' pieces in the swarm first, and if all pieces are equally rare it will use the "tit for tat" algorithm and request a piece from peers that are flagged as both 'interesting' and 'interested' so the exchange can be mutually beneficial to both peers.

Re: Why make sequential downloading and last piece options independet?

Posted: Wed Feb 03, 2016 11:30 pm
by FliessendWasser
mo0n_snier wrote: Yes, but I didn't said to make that the default behaviour.
What I mean is that when clicking "Download in sequential order" also "Download first and last piece first" to be automatically selected.

I was refering to this commit:
Make "Download in sequential order" and "Download first and last piece first" options independent. (glassez)
Yee, I had to re-read your thoughts and my reply again... my fault.

BitTorrent is based on an exchange of random pieces of a torrent. If this is not possible, the torrent is stuck. No exchange anymore.
Not 'random' the default is to request the 'rarest' pieces in the swarm first, and if all pieces are equally rare it will use the "tit for tat" algorithm and request a piece from peers that are flagged as both 'interesting' and 'interested' so the exchange can be mutually beneficial to both peers.
Pretty much what I meant, but didn't write down. ;D

Re: Why make sequential downloading and last piece options independet?

Posted: Thu Feb 04, 2016 5:46 am
by mo0n_snier
Yes I understand what you are saying about downloading random. Also thanks for the bittorrent pdf, it was a nice read.
I know that it's better for torrents to request random pieces of files, but the sequential order is not used for all the torrents,j ust when the user activates it.
For me it realy nice to start to download a movie torrent and be able to watch it right away also in my own player, this was the reason that made me switch to qbittorrent. The streaming feature in uTorrent is complicated and doesn't work as good.

What I suggest is that when select the "Download in sequential order" option to auto-select "Download first and last piece first" as this is most likely what people want. This is just for convenience.
Also this behavior was used before and I want to ask if there is any reason to not select "Download first and last piece first" and if possible to revert to this behaviour.

Re: Why make sequential downloading and last piece options independet?

Posted: Thu Feb 04, 2016 7:11 pm
by ciaobaby
and I want to ask if there is any reason to not select "Download first and last piece first" and if possible to revert to this behaviour.
The issue of purely sequential piece downloading 0 -> 1 -> 2 -> 3 ... ... is that it may not download the pieces of the 'file' that actually contain the necessary meta-information that allow the file to be opened in a media player application.
The behaviour of automatically downloading first and last piece simultaneously with sequential download IS to ensure that you CAN start watching BEFORE it is fully completed.

So you have options, ... ... You can have the behaviour disabled and then have to WAIT for all the pieces to be complete before you can watch whatever it is you are downloading, OR you can leave well alone, accept that it is done for YOUR  benefit and stop trying to 'break' the very thing that makes it possible for you to watch 'partial' payloads.

.... ... Your choice.

Re: Why make sequential downloading and last piece options independet?

Posted: Thu Feb 04, 2016 10:28 pm
by mo0n_snier
I think we don't understand each other.
I want to have the option "Download first and last piece first" automatically selected when you select "Download in sequential order".
This ensures that if there is meta-data at the end of the file that is needed for playback it will be downloaded and the movie will be playable like you said. And this is what "Download in sequential order" is mostly used for, playing a video file that is not fully downloaded.

This behavior was default prior to qbittorrent 3.3.0, but was disabled with this commit:
OTHER: Make "Download in sequential order" and "Download first and last piece first" options independent. (glassez)

I think it's more convenint to have it enabled and that is why I'm asking this.

Re: Why make sequential downloading and last piece options independet?

Posted: Fri Feb 05, 2016 4:36 pm
by ciaobaby
This behavior was default prior to qbittorrent 3.3.0, but was disabled with this commit:
Aha the penny drops!

You are arguing against the proposal.

Now while I understand why the two happen to be connected, I do also understand that "first and last piece" being auto selected when sequential download is selected is confusing and counter-intuitive, because at first look, the two are mutually exclusive, therefore should not be simultaneously applicable.
However that point is why they have been split, so then, and most importantly, it is up to the end user to decide what to select for their particular purpose.

Software should never try to pre-empt the ignorance of the end-user, when that happens ... ... The result is M$ Windows Vista (and Windows 10).

Re: Why make sequential downloading and last piece options independet?

Posted: Sat Feb 06, 2016 6:00 am
by mo0n_snier
Agreed, the software should not limit the user's options.

What I don't understand is why was this implemntented and what is the reason.
Is there a reson someone would want them spearated?

From my point of view "Download in sequential order" and "Download first and last piece first" serve the puropose of previewing files, mosty used for video. In many cases "Download in sequential order" is not usable without "Download first and last piece first" so that is why I am suggesting they should be linked.

What I'm asking is: is there a reason to use "Download first and last piece first" on it's own?
If there is then they should be separate indeed, if there is not then they can be linked.

Re: Why make sequential downloading and last piece options independet?

Posted: Sat Feb 06, 2016 5:17 pm
by ciaobaby
It's something that was there from day one of "sequential downloading" being implemented, then followed (some time later) the usual "Why does this happen?"  and the "I don't like this happening!" complainers (probably ones who don't understand why and don't bother to ask why first). There was, as I recall a discussion about extending "first and last piece" to get piece 0 & piece 1 along with piece n & piece n-1 so that the headers and file meta-data was more likely to be available, and I guess at some point it was decided to separate the two and now those who know can take the necessary steps and those who don't know can remain in blissful ignorance.

Personally I prefer to educate the end users, even if only slightly, but it always seems to be the 'Linux way' of "Tell them nothing! And let's see if they can figure it out! and while they are figuring it out ... we will change it completely" that takes precedence. I've often thought that if the "Open Source" community ever managed to get organised, The likes of Microsoft, Apple and Adobe wouldn't stand a chance of surviving, but while it remains as a bunch of disparate programming 'mavericks' to whom 'organisation' is one small step from 'fascism' it will sadly remain an "also-ran".

Re: Why make sequential downloading and last piece options independet?

Posted: Sat Feb 06, 2016 6:33 pm
by mo0n_snier
I remember that discussion but I don't remember if it was set to download n and n-1 also.
Was it implemented?

What if you implement two options in the options menu as tick boxes:
1. "Download in sequential order" also selects "Download first and last piece first" 1/0 tickbox
2. "Download first and last piece first" also downloads piece 1 and piece n-1 1/0 tickbox
This would make everybody happy :)

Yes, indeed the linux/unix way is better. Simple stuff that works as expected.
About the chaos in open-source world I think this is also it's strength. You don't know what will be made next.

Re: Why make sequential downloading and last piece options independet?

Posted: Sat Feb 06, 2016 9:27 pm
by ciaobaby
Yes, indeed the linux/unix way is better. Simple stuff that works as expected.
Absolutely "Do one thing, but do it well" should be the ethos of every programmer/developer, and yes the 'mavericks' are great because that fuels diversity and innovation in software. The problem comes when a piece of software develops "a life of it's own". At that point the developer ego with the "Look what I can do" needs to be curbed somewhat and the project needs a "road map" that everyone works towards and a defined set of rules that every one adheres to.

I was baffled by a seven day discussion about whether to use 3,4 or 5 spaces for a tab, yet NOBODY bothered to define the 'naming' guidelines so there are functions and variables using all lowercase, all UPPERCASE, CamelCase, under_scores and any mixture of them all. Properties with 'Designer Wizard'  generated name (textfield01 textfield02 and so on) some have meaningful names that are a mish-mash of letter case underscores etc, and there's an 'argument' going on about bloody tab sizes!

As for annotations and comments, well there is the usual huge chunk of licence text in every document, but this module does .... what ..... and uses .... .something ... almost nothing. Just how exactly are additional developers going to bother joining something they have to start almost from scratch with??

Fix the damned code people, make it so it is intelligible. So long as tabs are more than two spaces f****** wide it really does not matter. 


[/rant]