Преглед изворни кода

Deploy kVLCAutomaticallyPlayNextItem for local files

(cherry picked from commit abe2f6816ef5c3d1a97f1624879806d03da05765)
Felix Paul Kühne пре 9 година
родитељ
комит
b15abb2963
1 измењених фајлова са 12 додато и 0 уклоњено
  1. 12 0
      Sources/VLCPlaybackController+MediaLibrary.m

+ 12 - 0
Sources/VLCPlaybackController+MediaLibrary.m

@@ -82,6 +82,12 @@ Open a file in the libraryViewController without changing the playstate
 
 - (void)configureWithShowEpisode:(MLShowEpisode *)showEpisode
 {
+    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+    if (![defaults boolForKey:kVLCAutomaticallyPlayNextItem]) {
+        [self playMediaLibraryObject:showEpisode.files.anyObject];
+        return;
+    }
+
     NSArray *episodes = [[showEpisode show] sortedEpisodes];
     NSMutableArray *files = [NSMutableArray arrayWithCapacity:episodes.count];
     for (MLShowEpisode *episode in episodes) {
@@ -95,6 +101,12 @@ Open a file in the libraryViewController without changing the playstate
 
 - (void)configureWithAlbumTrack:(MLAlbumTrack *)albumTrack
 {
+    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+    if (![defaults boolForKey:kVLCAutomaticallyPlayNextItem]) {
+        [self playMediaLibraryObject:albumTrack.anyFileFromTrack];
+        return;
+    }
+
     NSArray *tracks = [[albumTrack album] sortedTracks];
     NSMutableArray *files = [NSMutableArray arrayWithCapacity:tracks.count];
     for (MLAlbumTrack *track in tracks) {