Commit 08d3b61b authored by Tobias's avatar Tobias

request DB in watch app from iPhone when showing library after launch the...

request DB in watch app from iPhone when showing library after launch the first time and library is empty
parent 66cd58d9
......@@ -18,6 +18,7 @@ extern NSString *const VLCWatchMessageNamePlayFile;
extern NSString *const VLCWatchMessageNameSetVolume;
extern NSString *const VLCWatchMessageNameNotification;
extern NSString *const VLCWatchMessageNameRequestThumbnail;
extern NSString *const VLCWatchMessageNameRequestDB;
extern NSString *const VLCWatchMessageKeyURIRepresentation;
......
......@@ -16,6 +16,7 @@ NSString *const VLCWatchMessageNamePlayFile = @"playFile";
NSString *const VLCWatchMessageNameSetVolume = @"setVolume";
NSString *const VLCWatchMessageNameNotification = @"notification";
NSString *const VLCWatchMessageNameRequestThumbnail = @"requestThumbnail";
NSString *const VLCWatchMessageNameRequestDB = @"requestDB";
NSString *const VLCWatchMessageKeyURIRepresentation = @"URIRepresentation";
......
......@@ -108,6 +108,8 @@ static VLCWatchCommunication *_singeltonInstance = nil;
[self setVolumeFromWatch:message];
} else if ([name isEqualToString:VLCWatchMessageNameRequestThumbnail]) {
[self requestThumnail:message];
} else if([name isEqualToString:VLCWatchMessageNameRequestDB]) {
[self copyCoreDataToWatch];
} else {
APLog(@"Did not handle request from WatchKit Extension: %@",message);
}
......
......@@ -17,6 +17,8 @@
#import "VLCWatchTableController.h"
#import "MLMediaLibrary+playlist.h"
#import <WatchConnectivity/WatchConnectivity.h>
#import "VLCWatchMessage.h"
static NSString *const rowType = @"mediaRow";
......@@ -67,6 +69,13 @@ static NSString *const rowType = @"mediaRow";
self.tableController = tableController;
[self updateData];
if (self.tableController.objects.count == 0) {
NSDictionary *dict = [VLCWatchMessage messageDictionaryForName:VLCWatchMessageNameRequestDB];
[[WCSession defaultSession] sendMessage:dict
replyHandler:nil
errorHandler:nil];
}
}
- (void)table:(WKInterfaceTable *)table didSelectRowAtIndex:(NSInteger)rowIndex {
......
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