[vlc-commits] [Git][videolan/vlc][master] macosx: Only display "play next" items in playback end view that are actually playable
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Tue Jun 17 16:56:05 UTC 2025
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
bf1ef706 by Claudio Cambra at 2025-06-17T16:41:39+00:00
macosx: Only display "play next" items in playback end view that are actually playable
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
1 changed file:
- modules/gui/macosx/views/VLCPlaybackEndViewController.m
Changes:
=====================================
modules/gui/macosx/views/VLCPlaybackEndViewController.m
=====================================
@@ -32,6 +32,8 @@
#import "library/VLCLibraryUIUnits.h"
#import "playqueue/VLCPlayQueueController.h"
+#include <vlc_interface.h>
+
static const NSTimeInterval kVLCPlaybackEndTimeout = 10;
static const NSTimeInterval kVLCPlaybackEndUpdateInterval = 0.1;
@@ -145,13 +147,22 @@ NSString * const VLCPlaybackEndViewReturnToLibraryNotificationName = @"VLCPlayba
return nil;
}
- const NSInteger itemIdx = [itemSiblingItemPaths indexOfObject:itemUrl.lastPathComponent];
+ NSArray<NSString *> * const playableExtensions = [[[NSString
+ stringWithCString:EXTENSIONS_MEDIA encoding:NSUTF8StringEncoding]
+ stringByReplacingOccurrencesOfString:@"*." withString:@""]
+ componentsSeparatedByString:@";"];
+ NSArray<NSString *> * const itemPlayableSiblingItemPaths = [[itemSiblingItemPaths
+ sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)]
+ filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(NSString * const _Nonnull siblingItemPath, NSDictionary<NSString *, id> * const _Nullable bindings) {
+ return [playableExtensions containsObject:siblingItemPath.pathExtension.lowercaseString];
+ }]];
+ const NSInteger itemIdx = [itemPlayableSiblingItemPaths indexOfObject:itemUrl.lastPathComponent];
NSParameterAssert(itemIdx != NSNotFound);
- if (itemIdx + 1 >= itemSiblingItemPaths.count) {
+ if (itemIdx + 1 >= itemPlayableSiblingItemPaths.count) {
NSLog(@"Played item was last in parent folder.");
return nil;
}
- NSString * const nextItemFileName = itemSiblingItemPaths[itemIdx + 1];
+ NSString * const nextItemFileName = itemPlayableSiblingItemPaths[itemIdx + 1];
NSURL * const nextItemURL =
[[NSURL fileURLWithPath:parentFolderPath] URLByAppendingPathComponent:nextItemFileName];
return [VLCInputItem inputItemFromURL:nextItemURL];
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/bf1ef7069fd472b553712e4121e7468ffab595d4
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/bf1ef7069fd472b553712e4121e7468ffab595d4
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list