Commit eaa42d42 authored by Tobias's avatar Tobias
Browse files

fix off-by-one error in language selection for subtitle download

parent b12a70fe
......@@ -179,15 +179,12 @@
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"LANGUAGE", nil)
message:nil preferredStyle:UIAlertControllerStyleActionSheet];
NSArray *languages = _osoFetcher.availableLanguages;
NSUInteger count = languages.count;
MDFSubtitleLanguage *item;
NSArray<MDFSubtitleLanguage *> *languages = _osoFetcher.availableLanguages;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *currentCode = [defaults stringForKey:kVLCSettingLastUsedSubtitlesSearchLanguage];
for (NSUInteger i = 0; i < count; i++) {
for (MDFSubtitleLanguage *item in languages) {
NSString *itemID = item.ID;
item = languages[i];
UIAlertAction *action = [UIAlertAction actionWithTitle:item.localizedName
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment