From c299c1432c04a103dd5744f23679a2aecdb3c78d Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Wed, 25 Oct 2023 16:41:39 +0000 Subject: [PATCH] Report more platform names, and clean up blobs on default on iOS like on Android. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4578 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- core/core.js | 4 ++-- src/task.c | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/core/core.js b/core/core.js index e5fa906b..f8505102 100644 --- a/core/core.js +++ b/core/core.js @@ -74,12 +74,12 @@ const k_global_settings = { }, blob_fetch_age_seconds: { type: 'integer', - default_value: (platform() == 'android' ? 0.5 * 365 * 24 * 60 * 60 : undefined), + default_value: (platform() == 'android' || platform() == 'iphone' ? 0.5 * 365 * 24 * 60 * 60 : undefined), description: 'Only blobs mentioned more recently than this age will be automatically fetched.', }, blob_expire_age_seconds: { type: 'integer', - default_value: (platform() == 'android' ? 1.0 * 365 * 24 * 60 * 60 : undefined), + default_value: (platform() == 'android' || platform() == 'iphone' ? 1.0 * 365 * 24 * 60 * 60 : undefined), description: 'Blobs older than this will be automatically deleted.', }, }; diff --git a/src/task.c b/src/task.c index d824d2fa..746c6f07 100644 --- a/src/task.c +++ b/src/task.c @@ -706,6 +706,13 @@ static JSValue _tf_task_platform(JSContext* context, JSValueConst this_val, int return JS_NewString(context, "windows"); #elif defined(__ANDROID__) return JS_NewString(context, "android"); +#elif defined(__APPLE__) +#include +#if TARGET_OS_IPHONE + return JS_NewString(context, "iphone"); +#else + return JS_NewString(context, "macos"); +#endif #elif defined(__linux__) return JS_NewString(context, "linux"); #else