## Description
Cumulative fixes for RC2/Final.
### 1) Single-title pla…yback picks the textless cut over the translated one
For single-title playback, the plain presentation is still chosen first. But if the heuristics picked a different named feature that is the **same presentation** as that choice (`IsSamePresentation`: same length, chapters and clip durations, with at least one clip in common), the heuristics' pick is used.
- Among copies of one presentation, the heuristics choose the copy with the fullest streams. So a translated copy such as `_eng` wins, while an audio-described or dubbed copy, having fewer streams, never does.
- A different edition isn't the same presentation, because its length differs. So `FPL_MainFeature_EXT` still loses to `FPL_MainFeature`, and *Aliens* and *The Abyss* still play the theatrical cut.
- Matching the language suffix against the user's language was rejected, because that preference can be changed in the GUI. Treating every `_xxx` suffix as the plain presentation was rejected too, since there are no other examples of what those suffixes mean.
**Testing**
- New test `Movie_SingleTitleKeepsTheHeuristicsCopyOfThePlainFeature`, modelled on Avatar, fails without the change and passes with it. `Movie_SingleTitlePrefersThePlainFeatureOverAnExtendedCut` (the *Aliens* case) still passes.
- **Single-title library scan** (similar-video grouping off) of about 290 discs, 74 of which name a feature in their project:
- Avatar Disc 1 now picks 800.
- Aliens and The Abyss (both discs of each) still pick the theatrical 800 over their `_EXT` cuts.
- Every other disc is unchanged.
- **Multi-version scan** (automatic grouping): results identical to before the change.
### 2) Add advanced setting to disable the use of the project authoring file when determining playlists
```
<advancedsettings>
<videolibrary>
<dontparseblurayprojectfile>true</dontparseblurayprojectfile>
</videolibrary>
</advancedsettings>
```
### 3) Don't reject a playlist whose extension data is invalid
`ParseMPLS` no longer fails when the extension data can't be parsed. It logs `Invalid MPLS - extension data at {} ignored` and carries on without the extension's sub-paths, clearing any it had partly read.
#### Testing
- New test `TestMPLSParser.InvalidExtensionDataIsIgnored` reads a copy of the disc's `00888.mpls` and expects 9 play items, 9 sub-play-items, 16 chapters, a duration of 6,567,556 ms and no extension sub-paths. It fails without the fix.
- In the test file, the clip numbers, stream languages and HDR metadata were altered. The header pointer and the bytes it points at are unchanged, so the file still reproduces the fault.
- **On the disc image:** all 144 playlists now read (142 before). The heuristics find 889 and 888 as the movie, and both are added to the library as versions.
## Motivation and context
### 1) Single-title playback picks the textless cut over the translated one
For single-title playback, the plain `FPL_MainFeature` is preferred over its variants so that an extended, audio-described or dubbed presentation isn't chosen by default. On discs that name a language-specific copy of the feature, the plain name isn't always the best presentation.
*Avatar: Fire and Ash* (UHD) names three feature-length playlists:
| Playlist | Name | Streams | Clips |
|---|---|---|---|
| 800 | `FPL_MainFeature_eng` | 7 audio, 6 subtitles | Branch set A |
| 1661 | `FPL_MainFeature` | 7 audio, 6 subtitles | Branch set B |
| 1309 | `FPL_MainFeature_Narrative` | 1 audio (description) | Branch set A |
800 and 1661 share the same length, chapters and clip durations. They differ only in 10 short branch clips (14–49 s each), where 800 carries English on-screen translation burned into the picture (for example, the whale dialogue at 0:14:19) and 1661 is textless. With subtitles off, 1661 shows no translation of the alien dialogue at all.
The heuristics pick 800, the fullest copy of that presentation, but the plain-name preference overrode them with 1661. With automatic versions, 800 is offered and 1661 is dropped as a duplicate, so the two paths also disagreed.
### 3) Don't reject a playlist whose extension data is invalid
On *Léon: The Professional* (2in1 UHD), Kodi never offered the movie. Both cuts, 888 (theatrical, 1:49:27) and 889 (extended, 2:12:57), failed to read:
```
GetPlaylistsFromDisc: Unable to get playlist 888
GetPlaylistsFromDisc: Unable to get playlist 889
```
With the feature missing, the heuristics fell back to the longest remaining title, playlist 875 at 43:49.
The cause is in the playlists themselves. Their header field `ExtensionData_start_address` is 2308, which points into the playlist's own sub-path rather than at the extension data, which actually starts at 2756, straight after the chapter marks. Read from the wrong offset, the extension's "length" comes out as 3,599,106,049. The size check then fails, and `ParseMPLS` rejected the whole playlist.
Everything else in the two playlists is valid: 9 seamless play items, a Dolby Vision enhancement-layer sub-path and 16 chapters. The extension data only holds optional information, here static HDR metadata. Kodi only uses the extension's sub-paths, which this disc doesn't have. libbluray ignores a bad extension block (`_mpls_parse` disregards the result of `bdmv_parse_extension_data`), so these playlists play fine through the disc menu.
Fix: #28440
## How has this been tested?
## What is the effect on users?
## Screenshots (if appropriate):
## Types of change
- [X] **Improvement (v22 new feature polish)** (non-breaking change which improves a new feature in v22)
## Checklist:
- [X] My code follows the **[Code Guidelines](https://github.com/xbmc/xbmc/blob/master/docs/CODE_GUIDELINES.md)** of this project
- [X] I have read the **[Contributing](https://github.com/xbmc/xbmc/blob/master/docs/CONTRIBUTING.md)** document
- [X] I have added tests to cover my change
- [X] All new and existing tests passed
## Summary by CodeRabbit
* **Bug Fixes**
* Improved playlist selection for single-title movies when multiple named presentations contain the same content. The app now favors the presentation identified as the fuller copy, helping ensure the selected movie includes the expected content.