Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLC-iOS
Commits
65cf74bf
Commit
65cf74bf
authored
Sep 20, 2015
by
Tobias
Browse files
use watch directory as temporary directory for file transfers to watch
parent
08d3b61b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Sources/VLCWatchCommunication.m
View file @
65cf74bf
...
...
@@ -206,7 +206,8 @@ static VLCWatchCommunication *_singeltonInstance = nil;
MLMediaLibrary
*
library
=
[
MLMediaLibrary
sharedMediaLibrary
];
NSPersistentStoreCoordinator
*
libraryPSC
=
[
library
persistentStoreCoordinator
];
NSPersistentStore
*
persistentStore
=
[
libraryPSC
persistentStoreForURL
:[
library
persistentStoreURL
]];
NSURL
*
tmpURL
=
[
NSURL
fileURLWithPath
:[
NSTemporaryDirectory
()
stringByAppendingPathComponent
:
persistentStore
.
URL
.
lastPathComponent
]];
NSURL
*
tmpDirectoryURL
=
[[
WCSession
defaultSession
]
watchDirectoryURL
];
NSURL
*
tmpURL
=
[
tmpDirectoryURL
URLByAppendingPathComponent
:
persistentStore
.
URL
.
lastPathComponent
];
NSMutableDictionary
*
destOptions
=
[
persistentStore
.
options
mutableCopy
]
?:
[
NSMutableDictionary
new
];
destOptions
[
NSSQLitePragmasOption
]
=
@{
@"journal_mode"
:
@"DELETE"
};
...
...
@@ -250,7 +251,8 @@ static VLCWatchCommunication *_singeltonInstance = nil;
-
(
void
)
transferImage
:(
UIImage
*
)
image
forObjectID
:(
NSManagedObjectID
*
)
objectID
{
NSString
*
imageName
=
[[
NSUUID
UUID
]
UUIDString
];
NSURL
*
tmpURL
=
[
NSURL
fileURLWithPath
:[
NSTemporaryDirectory
()
stringByAppendingPathComponent
:
imageName
]];
NSURL
*
tmpDirectoryURL
=
[[
WCSession
defaultSession
]
watchDirectoryURL
];
NSURL
*
tmpURL
=
[
tmpDirectoryURL
URLByAppendingPathComponent
:
imageName
];
NSData
*
data
=
UIImageJPEGRepresentation
(
image
,
0
.
7
);
[
data
writeToURL
:
tmpURL
atomically
:
YES
];
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment