mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
45 lines
No EOL
1.1 KiB
JavaScript
45 lines
No EOL
1.1 KiB
JavaScript
(function () {
|
|
|
|
function getLocalMediaSource(serverId, itemId) {
|
|
return null;
|
|
}
|
|
|
|
function saveOfflineUser(user) {
|
|
var deferred = DeferredBuilder.Deferred();
|
|
deferred.resolve();
|
|
return deferred.promise();
|
|
}
|
|
|
|
function getCameraPhotos() {
|
|
var deferred = DeferredBuilder.Deferred();
|
|
|
|
if (window.CameraRoll) {
|
|
|
|
var photos = [];
|
|
|
|
CameraRoll.getPhotos(function (result) {
|
|
photos.push(result);
|
|
});
|
|
|
|
setTimeout(function () {
|
|
|
|
// clone the array in case the callback is still getting called
|
|
Logger.log('Found ' + photos.length + ' in camera roll');
|
|
|
|
deferred.resolveWith(null, [photos]);
|
|
|
|
}, 2000);
|
|
|
|
} else {
|
|
deferred.resolveWith(null, [[]]);
|
|
}
|
|
return deferred.promise();
|
|
}
|
|
|
|
window.LocalAssetManager = {
|
|
getLocalMediaSource: getLocalMediaSource,
|
|
saveOfflineUser: saveOfflineUser,
|
|
getCameraPhotos: getCameraPhotos
|
|
};
|
|
|
|
})(); |