||Use task priority to pick between similar files' sources at timeframe end
||From https://github.com/Flexget/Flexget/issues/701 (2015-12-12):
> From http://flexget.com/ticket/3106
> After a timeframe expires, if the target quality has not been met but suitable files were found matching the valid quality range, currently the "best quality found so far" is chosen.
> In some cases this same "best quality" is available from multiple sources, such as multiple RSS feeds.
> Where the tasks supplying those RSS feeds were in an order of priority, I'd expect Flexget to choose the file from the feed which was downloaded first. But from observation this is not always what happens: I often get a file downloaded from a lesser-preferred source instead, even though a suitable match was available from a preferred source.
Two comments from @crawln45 the same day:
> As far as this goes. I think this is done by what time the 'matching' best quality is seen. from what I can see regardless of what priority the rss feeds are. Since I don't believe it stores what feed or source each file is from just that the file has been found.
> @gazpachoking If multiple 'best quality' available is matched. Isn't the 1st one seen downloaded. I think that's what I read when going through the series code, but it seems so jumbled I'm not 100% sure on that.
||After timeframe expires, best quality found is downloaded even if a better match to target is available
||From https://github.com/Flexget/Flexget/issues/699 (2015-12-12), edited slightly:
Consider a configuration such as
timeframe: 2 hours
target: 720p webdl
quality: 720p-1080p hdtv+
and the following scenario:
Flexget finds a suitable episode in two formats: 720p hdtv and 1080p hdtv, whether at the same time or within two hours of each other. Due to them not fulfilling the "webdl" requirement of the target quality it correctly doesn't download anything yet.
The timeframe then expires and there is still no 720p webrip available.
At this point, Flexget's current behaviour is to download the best quality it has seen, which in this case is the 1080p hdtv.
This may be what is wanted, but it also may not be. It's not what I want, and I would imagine that most users would agree that in this scenario the 720p hdtv would be more appropriate, since the resolution matches the target, and the source (though not matching the target) is in the valid quality range. On the other hand, the 1080p hdtv, which was downloaded, does not match the target resolution (though it is in the valid range) and the source also does not match the target (though again it is in the valid range).
I think the default behaviour should be to match as many of the target requirements as possible, while of course staying within the quality requirements.
If it seems not all users would want this new default behaviour, it could be configurable. It could either be a "choose closest match: yes or no" option, or it could be more sophisticated with the "target" option expanded. A user who wants "720p webrip" could somehow specify that the 720p part is important, and the webrip part not so important, or some other such combination.
liiight asked in a comment on the old ticket:
> if you don't want 1080p to begin with? why even include it in the original requirement? if that is not a valid option on your part, do not include it.
> i'm not saying i'm against adding a 'closest match' feature, that does sound interesting and doable, i'm just wondering.
The answer is that I do want 1080p if no 720p is available, but I prefer 720p. At present I have no way to tell Flexget that I _prefer_ a "worse" quality. Or, more accurately, I sort of am able to tell Flexget that -- that's what I'm saying in the "target" -- but it isn't taken into account in this way when timeframe expires.
> You specified a rant of 720p-1080p at hdtv or above. 1st it's going to pick the 'best' qualities available. If you wish that it doesn't. Then that is up to you to specify. If you specify a range well then it's going to give you the best of that range since there's not a single option.
Well yes, that's the problem, that's why I opened this ticket. I specify as "target" 720p webdl, so it ought to be obvious that I prefer 720p webdl. But whether that means I prefer 720p hdtv over 1080p hdtv, if these end up being the only available options, is admittedly unclear. I want an option which allows me to make this clear to flexget.
> All assigned values for qualities are given a numeric value. Those values are then totaled giving you a numeric weight to each episode, as long as the values are within the range assigned. That is then calculated on what episode is the 'best'. So there's no way currently to assign 720p as important over 1080p since their values are treated equally when added to the other values present.
So I want a way to configure these weights.
@crawln45 then suggested:
> @liiight thoughts making a new option per quality list:
> - 720p hdtv:
> priority: 2
> - 1080p hdtv:
> priority: 3
> - 1080p webdl:
> priority: 1
> This way it selects the best out of that list if found on which one you would rather have after timeframe. Else revert to a quality setting.
I agreed that this seems like a decent solution, as did @pesho-shaibata.
@paranoidi disagreed, saying it was making what is already a confusing option more so, and added:
> Quality option could be improved to take list of requirements in the order of preferece.
@vincentbernat then said:
> I would also be interested to be able to specify an ordered list of preferences (or even an unordered list). For example, I want to be able to express that I accept "720p h264" and "720p|1080p h265". I don't want to accept "1080p h264". I think, this is currently not possible.
> Another option for me would be to be able to have something like that:
> timeframe: 12 hours
> target: 1080p dd5.1|ac3|dts|dtshd
> - "720p|1080p webrip|hdtv|webdl|bluray h265 !aac"
> - "720p webrip|hdtv|webdl|bluray h264 !aac"
> Unfortunately, the quality setting of the serie plugin doesn't support a list (while the quality plugin does, this is a bit confusing).
> Would the reorder_quality plugin solve this problem?
> above: 1080p