PlainApp
API 參考

偏好設定

應用程式設定。完整讀取偏好設定需要開發者模式;依 key 讀取與寫入須遵守下方註冊的索引鍵原則。

偏好設定鍵 (63)

存取權限遵循各設定項目的註冊策略;完整讀取原始偏好值需要啟用開發者模式。

鍵名用途存取權限
dlnaEnable the DLNA service. 本機和遠端均可讀寫
device_nameDevice display name. 本機和遠端均可讀寫
feed_auto_refreshEnable automatic feed refresh. 本機和遠端均可讀寫
feed_auto_refresh_intervalAutomatic feed refresh interval in seconds. 本機和遠端均可讀寫
feed_auto_refresh_only_wifiRestrict automatic feed refresh to Wi-Fi. 本機和遠端均可讀寫
ai_image_search_enabledEnable semantic image search. 本機和遠端均可讀寫
ai_image_search_modelSelected image-search model. 本機和遠端均可讀寫
dlna_allowed_sendersAllowed DLNA sender identities. 本機和遠端均可讀寫
dlna_denied_sendersDenied DLNA sender identities. 本機和遠端均可讀寫
dark_themeTheme selection: USE_DEVICE_THEME, ON or OFF. 本機和遠端均可讀寫
amoled_dark_themeUse the AMOLED dark-theme option. 本機和遠端均可讀寫
pdf_follow_dark_themeApply the current dark theme to PDF viewing. 本機和遠端均可讀寫
localeInterface language. 本機和遠端均可讀寫
show_hidden_filesShow hidden files in file browsing. 本機和遠端均可讀寫
feed_font_scaleFeed-reader font scale. 本機和遠端均可讀寫
editor_wrap_contentWrap long editor lines. 本機和遠端均可讀寫
editor_font_sizeEditor font size. 本機和遠端均可讀寫
editor_status_barShow the editor status bar. 本機和遠端均可讀寫
desktop_home_featuresFeatures displayed on the desktop home page. 本機和遠端均可讀寫
desktop_rail_features桌面導覽列中顯示的功能。 本機和遠端均可讀寫
media_excluded_dirsDirectories hidden from media pages; file indexing and file search remain available. 本機和遠端均可讀寫
desktop_upload_dirs依桌面媒體類別儲存的上傳目錄路徑。 本機和遠端均可讀寫
audio_sort_byAudio-library sort order. 本機和遠端均可讀寫
video_sort_byVideo-library sort order. 本機和遠端均可讀寫
image_sort_byImage-library sort order. 本機和遠端均可讀寫
doc_sort_byDocument-library sort order. 本機和遠端均可讀寫
file_sort_byFile-browser sort order. 本機和遠端均可讀寫
pkg_sort_byInstalled-package sort order. 本機和遠端均可讀寫
audio_play_modeAudio playback repeat or shuffle mode. 本機和遠端均可讀寫
audio_playback_speedAudio playback speed multiplier. 本機和遠端均可讀寫
pomodoro_settingsPomodoro work, break and round configuration. 本機和遠端均可讀寫
screen_mirror_qualityScreen-mirror quality preset. 本機和遠端均可讀寫
clipboard_directionsClipboard synchronization direction for each peer. 僅本機可讀寫
http_portHTTP listener port. 僅本機可讀寫
https_portHTTPS listener port. 僅本機可讀寫
background_service_enabledEnable the background service. 僅本機可讀寫
remote_accessEnable remote access. 僅本機可讀寫
developer_modeEnable developer tools and full preference or database access. 僅本機可讀寫
allow_any_hostAllow requests with arbitrary HTTP host names. 僅本機可讀寫
nearby_discoverableAllow nearby devices to discover this device. 僅本機可讀寫
notification_filterNotification synchronization filter configuration. 僅本機可讀寫
launcher_shortcutsConfigured launcher shortcuts. 僅本機可讀寫
image_grid_cells_per_rowImage-grid column count. 僅本機可讀寫
video_grid_cells_per_rowVideo-grid column count. 僅本機可讀寫
httpsEnable HTTPS. 僅本機可讀寫
web_address_bar_expandedExpand the remote-access address bar. 僅本機可讀寫
passwordLocal password configuration. 僅本機可讀寫
password_typeSelected password mode. 僅本機可讀寫
login_require_approvalRequire local approval for remote login. 僅本機可讀寫
api_permissionsFeatures authorized for remote API clients. 僅本機可讀寫
dev_tokenDevelopment access token configuration. 僅本機可讀寫
log_levelApplication logging level. 僅本機可讀寫
auto_check_updateAutomatically check for application updates. 僅本機可讀寫
skip_versionApplication update version to skip. 僅本機可讀寫
mdns_hostnamemDNS hostname used for local discovery. 本機或具備 HTTP_SERVER 能力的已登入遠端
recent_selected_dirs本裝置最近確認的絕對資料夾路徑,最多 8 筆,最新在前。Windows 使用正斜線,磁碟根目錄寫 D:/,不寫 D:。 ["D:/Projects/Photos", "E:/Backup/Photos"]本機或具有檔案權限的已登入遠端用戶端
app_home_featuresFeatures displayed by the native Tools page and its remote projection. 本機可讀寫,遠端唯讀
opaque_server_setupInternal OPAQUE password-authentication server setup. 僅限 Rust 內部使用
opaque_password_recordInternal OPAQUE password registration record. 僅限 Rust 內部使用
client_idInternal persistent device identity. 僅限 Rust 內部使用
adb_tokenInternal authorization token for local command access. 僅限 Rust 內部使用
master_secretInternal master secret. 僅限 Rust 內部使用
signature_key_pairInternal device signing key pair. 僅限 Rust 內部使用

型別定義

graphql
type Subscription {
  prefsChanged: Boolean!
}

type Mutation {
  removePref(key: String!): Boolean!
  setPref(key: String!, value: JSON!): Boolean!
}

type Query {
  prefs(keys: [String!]): JSON!
}

scalar JSON

操作

subscription

prefsChanged

接收偏好設定變更訊號;收到後重新取得所需設定欄位。

graphql
subscription prefsChanged {
  prefsChanged
}
mutation

removePref

移除可寫入偏好設定的覆寫值;auto_check_update 與 skip_version 會重設為預設值。請參閱允許的索引鍵清單。

graphql
mutation removePref($key: String!) {
  removePref(key: $key)
}
mutation

setPref

寫入已註冊且可寫入的偏好設定,驗證其值並套用其連帶效果。權限請參閱允許的索引鍵清單。

graphql
mutation setPref($key: String!, $value: JSON!) {
  setPref(key: $key, value: $value)
}
query

prefs

省略 keys 或傳入 null 時回傳所有已儲存的原始偏好(包括內部 key),需要啟用開發者模式。指定 key 時依白名單讀取;傳入空陣列回傳空物件。

graphql
query prefs($keys: [String!]) {
  prefs(keys: $keys)
}