Finished the multiple sources playlist submenu.
[MenuTunes.git] / MainController.m
index 3c1cb6c..2b3a7fb 100755 (executable)
@@ -290,9 +290,6 @@ static MainController *sharedController;
 {
     if ([networkController isConnectedToServer]) {
         [statusItem setMenu:[menuController menu]];
-        if ([[networkController networkObject] remote] == nil) {
-            [self networkError:nil];
-        }
     }
     
     if ( [self songChanged] && (timerUpdating != YES) ) {
@@ -409,7 +406,7 @@ static MainController *sharedController;
 {
     ITDebugLog(@"Selecting playlist %i", index);
     NS_DURING
-        [[self currentRemote] switchToPlaylistAtIndex:index];
+        [[self currentRemote] switchToPlaylistAtIndex:(index % 1000) ofSourceAtIndex:(index / 1000)];
     NS_HANDLER
         [self networkError:localException];
     NS_ENDHANDLER
@@ -502,6 +499,10 @@ static MainController *sharedController;
 
 - (ITMTRemote *)currentRemote
 {
+    if ([networkController isConnectedToServer] && ![[networkController networkObject] isValid]) {
+        [self networkError:nil];
+        return nil;
+    }
     return currentRemote;
 }