Commit db6398ee authored by Pierre SAGASPE's avatar Pierre SAGASPE

onedrive : fix wrong files in automatically play next Item

parent d4634a7e
......@@ -129,6 +129,7 @@
NSUInteger count = folderItems.count;
NSMutableArray *mediaItems = [[NSMutableArray alloc] init];
NSInteger firstIndex = 0;
NSInteger posIndex = 0;
for (NSInteger x = count - 1; x > -1; x--) {
VLCOneDriveObject *iter = folderItems[x];
if (iter.isFolder)
......@@ -138,13 +139,14 @@
[mediaItems addObject:[VLCMedia mediaWithURL:url]];
if (iter == selectedObject) {
firstIndex = mediaItems.count;
posIndex = mediaItems.count;
}
}
}
if (mediaItems.count > 0) {
NSLog(@"%s: %@ %li", __PRETTY_FUNCTION__, mediaItems, firstIndex);
firstIndex = mediaItems.count - posIndex;
NSLog(@"%s: %@ %li", __PRETTY_FUNCTION__, mediaItems, (long)firstIndex);
[vpc playMediaList:[[VLCMediaList alloc] initWithArray:mediaItems] firstIndex:firstIndex];
}
}
......
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