peteru wrote: ↑Tue Jul 09, 2019 16:45* After rescanning, the users is left in the "Last Scanned" bouquet. This is not intuitive at all and generates unnecessary requests for help. It would be much better if the current bouquet was not changed at all. If it needs to be changed (for example because it becomes empty after the scan), then perhaps the user can be left in Terrestrial LCN or even All Services. However, my preference would be to not change the bouquet at all.
* Also, after a (re)scan, it may be best to not start any service so that there is no question as to what service to choose. Perhaps just present the user with a user interface that gives them a list of services and makes them pick one.
The actual situation is a little more complicated.
At the beginning of the scan, the serviceref for the current playing service is saved and the service is stopped: the video shows a frozen frame from that service.
At the end of the scan, when the user presses OK, the code searches the bouquet list to find the bouquet names "Last Scanned" and sets this as the current bouquet if it's found.
It may seem obvious that it would be found, since a scan has just been performed, and the user hasn't had an opportunity to delete the Last Scanned bouquet.
However, if the user has disabled MENU>Setup>TV>Channel selection>Enable multiple bouquets, the bouquet list doesn't contain "Last Scanned", even though the bouquet exists.
If "Last Scanned" is set to be the current bouquet, the code then sets the service that was highlighted when OK was pressed to be the current service, and puts the saved previously playing service in the channel change history as the previously channel.
But it does not start the newly selected service playing.
The bouquet is presumably switched to Last Scanned so that the selected service will be in the bouquet, but this switch is not possible if Enable multiple bouquets is disabled.
Also, when the user presses OK when a radio service is highlighted in the list of scanned services, a radio service will be selected while in TV mode. However ,that is also possible to do via the Last Scanned bouquet in Channel Selection.
It's relatively easy to start the selected service playing, but I wonder why it was removed. The notes on the commit that removed it say "ServiceScan: Play service later as tuner was still in use", but that commit restarts the service in Screens.ScanSetup, which is only used if you do a Manual Scan rather than use Location scan.
So, what should it do? I agree with peteru that the user's bouquet should not be changed if possible. There is already a mechanism for the user to select a service (unless the user has disabled Enable multiple bouquets), and that is done already - the service is just not started.
The problem with the existing mechanism is that the user can select a service from a bouquet that is effectively Last Scanned, and that selected service may be one that isn't in their current bouquet.
This problem is solved in the scan done during the initial setup wizard by running the Channel Selection screen as the final step. Perhaps that's the cleanest way to finish off a scan from the Setup screens.