Plan 016 B4. The catalog artifact is about 0.6 GB and the app fetched it with no awareness of the connection: on a desktop that is a minute of bandwidth, on a phone it can be a month's allowance. It is now skipped on a cellular connection unless `AllowMeteredCatalogDownload` is on, with the toggle in Settings' Search Index section, where the text explaining what the catalog is already lives. The file layout is dictated by the cgo rule rather than by taste. `explore` is imported by `cmd/indexbuild`, which builds with CGO_ENABLED=0 and must not link Wails, so `netpolicy.go` holds the policy and the JSON parsing -- tested on every platform -- and the single platform call is a closure injected from `app.go`, which already names `application` legitimately. Three rules in it are load-bearing. An unknown answer is not a metered one: only mobile answers at all, and treating silence as metered would have disabled the download for every desktop user in the world. Cellular is the only signal available, because the runtime reports `wifi|cellular|ethernet|none` and no metered flag -- so a metered Wi-Fi cannot be detected and is not refused, which is documented rather than implied. And the gate runs before the first status write, so declining is a no-op instead of a job in the indicator and an error tier to dismiss. Two corrections to the plan while implementing it: the portable API is `application.Mobile.NetworkJSON()`, not `application.Android`'s, which exists only under the `android` build tag; and the permission is read at the moment a download would start, so enabling it takes effect on the next attempt rather than the next launch.
256 lines
7.5 KiB
TypeScript
256 lines
7.5 KiB
TypeScript
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
|
// This file is automatically generated. DO NOT EDIT
|
|
|
|
/**
|
|
* Config represents the application configuration.
|
|
* @module
|
|
*/
|
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
// @ts-ignore: Unused imports
|
|
import { Call as $Call, CancellablePromise as $CancellablePromise } from "@wailsio/runtime";
|
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
// @ts-ignore: Unused imports
|
|
import * as download$0 from "../download/models.js";
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
// @ts-ignore: Unused imports
|
|
import * as tracklist$0 from "../tracklist/models.js";
|
|
|
|
/**
|
|
* GetAllowMeteredCatalogDownload reports whether the ~0.6 GB Explore
|
|
* catalog may be fetched on a metered connection.
|
|
*/
|
|
export function GetAllowMeteredCatalogDownload(): $CancellablePromise<boolean> {
|
|
return $Call.ByID(2258585139);
|
|
}
|
|
|
|
/**
|
|
* GetDefaultPage returns the view the app opens to on launch.
|
|
*/
|
|
export function GetDefaultPage(): $CancellablePromise<string> {
|
|
return $Call.ByID(3209119019);
|
|
}
|
|
|
|
/**
|
|
* GetDownloadPreferences returns the configured auto-download
|
|
* guardrails.
|
|
*/
|
|
export function GetDownloadPreferences(): $CancellablePromise<download$0.AutoDownloadPrefs> {
|
|
return $Call.ByID(4104118319);
|
|
}
|
|
|
|
/**
|
|
* GetFavoritesIconStyle returns the configured icon style.
|
|
*/
|
|
export function GetFavoritesIconStyle(): $CancellablePromise<string> {
|
|
return $Call.ByID(3222927230);
|
|
}
|
|
|
|
/**
|
|
* GetFavoritesPlaylistID returns the configured default playlist ID.
|
|
*/
|
|
export function GetFavoritesPlaylistID(): $CancellablePromise<number> {
|
|
return $Call.ByID(4116868495);
|
|
}
|
|
|
|
/**
|
|
* GetLibraryDirectory returns the currently configured library directory path.
|
|
*/
|
|
export function GetLibraryDirectory(): $CancellablePromise<string> {
|
|
return $Call.ByID(2123565657);
|
|
}
|
|
|
|
/**
|
|
* GetPinDefaultPlaylist returns whether the default playlist
|
|
* is pinned to the top of the playlist view.
|
|
*/
|
|
export function GetPinDefaultPlaylist(): $CancellablePromise<boolean> {
|
|
return $Call.ByID(3818283301);
|
|
}
|
|
|
|
/**
|
|
* GetQueueFallback returns what plays, if anything, once the queue
|
|
* runs out.
|
|
*/
|
|
export function GetQueueFallback(): $CancellablePromise<string> {
|
|
return $Call.ByID(1504773860);
|
|
}
|
|
|
|
/**
|
|
* GetScanConcurrency returns the configured scan concurrency mode.
|
|
*/
|
|
export function GetScanConcurrency(): $CancellablePromise<string> {
|
|
return $Call.ByID(3233312385);
|
|
}
|
|
|
|
/**
|
|
* GetShortcuts returns the current shortcut bindings map.
|
|
*/
|
|
export function GetShortcuts(): $CancellablePromise<{ [_ in string]?: string } | null> {
|
|
return $Call.ByID(1616717634);
|
|
}
|
|
|
|
/**
|
|
* GetThemeAccentColor returns the configured accent colour.
|
|
*/
|
|
export function GetThemeAccentColor(): $CancellablePromise<string> {
|
|
return $Call.ByID(4264374057);
|
|
}
|
|
|
|
/**
|
|
* GetThemeBackgroundShade returns the configured background shade.
|
|
*/
|
|
export function GetThemeBackgroundShade(): $CancellablePromise<string> {
|
|
return $Call.ByID(578772653);
|
|
}
|
|
|
|
/**
|
|
* GetTrackListColumns returns the configured track-list columns.
|
|
*/
|
|
export function GetTrackListColumns(): $CancellablePromise<tracklist$0.Column[] | null> {
|
|
return $Call.ByID(3426289065);
|
|
}
|
|
|
|
/**
|
|
* Load reads and parses the config file from disk.
|
|
*/
|
|
export function Load(): $CancellablePromise<void> {
|
|
return $Call.ByID(2408891113);
|
|
}
|
|
|
|
/**
|
|
* ResetShortcuts resets all shortcuts to defaults.
|
|
*/
|
|
export function ResetShortcuts(): $CancellablePromise<void> {
|
|
return $Call.ByID(3197898083);
|
|
}
|
|
|
|
/**
|
|
* Save writes the config to disk. Refuses to write if the config
|
|
* was never successfully loaded — prevents overwriting user config
|
|
* with defaults during abnormal startup/shutdown sequences.
|
|
*/
|
|
export function Save(): $CancellablePromise<void> {
|
|
return $Call.ByID(1988945736);
|
|
}
|
|
|
|
/**
|
|
* SetAllowMeteredCatalogDownload saves the metered-download permission.
|
|
*
|
|
* There is nothing to validate and nothing to restart: the policy is
|
|
* read at the moment a download would start, so turning it on takes
|
|
* effect on the next attempt rather than needing this launch to be over.
|
|
*/
|
|
export function SetAllowMeteredCatalogDownload(allow: boolean): $CancellablePromise<void> {
|
|
return $Call.ByID(192700351, allow);
|
|
}
|
|
|
|
/**
|
|
* SetDefaultPage validates and saves a new launch page.
|
|
*/
|
|
export function SetDefaultPage(page: string): $CancellablePromise<void> {
|
|
return $Call.ByID(2714957423, page);
|
|
}
|
|
|
|
/**
|
|
* SetDownloadPreferences saves new auto-download guardrails. This only
|
|
* persists them; the download package cannot depend on config (config
|
|
* already depends on download for UserConfig), so making the change
|
|
* live without a restart is the caller's job — the frontend settings
|
|
* save calls this and download.Service.SetPreferences in the same
|
|
* action, and app.go's initDownloadRuntime applies the saved value to
|
|
* the running Manager at startup.
|
|
*/
|
|
export function SetDownloadPreferences(prefs: download$0.AutoDownloadPrefs): $CancellablePromise<void> {
|
|
return $Call.ByID(2655203755, prefs);
|
|
}
|
|
|
|
/**
|
|
* SetFavoritesIconStyle validates and saves a new icon style.
|
|
*/
|
|
export function SetFavoritesIconStyle(style: string): $CancellablePromise<void> {
|
|
return $Call.ByID(812590378, style);
|
|
}
|
|
|
|
/**
|
|
* SetFavoritesPlaylistID saves a new default playlist ID.
|
|
*/
|
|
export function SetFavoritesPlaylistID(id: number): $CancellablePromise<void> {
|
|
return $Call.ByID(2117079163, id);
|
|
}
|
|
|
|
/**
|
|
* SetLibraryDirectory validates and saves a new library directory,
|
|
* then emits the LibraryConfigChanged event so listeners (e.g. the
|
|
* Library scanner) can react.
|
|
*/
|
|
export function SetLibraryDirectory(dir: string): $CancellablePromise<void> {
|
|
return $Call.ByID(1352505021, dir);
|
|
}
|
|
|
|
/**
|
|
* SetPinDefaultPlaylist saves whether the default playlist
|
|
* should be pinned to the top of the playlist view.
|
|
*/
|
|
export function SetPinDefaultPlaylist(pin: boolean): $CancellablePromise<void> {
|
|
return $Call.ByID(372446849, pin);
|
|
}
|
|
|
|
/**
|
|
* SetQueueFallback validates and saves a new queue-fallback mode.
|
|
*/
|
|
export function SetQueueFallback(mode: string): $CancellablePromise<void> {
|
|
return $Call.ByID(2824429312, mode);
|
|
}
|
|
|
|
/**
|
|
* SetScanConcurrency validates and saves a new scan concurrency
|
|
* mode. The change takes effect on the next scan.
|
|
*/
|
|
export function SetScanConcurrency(mode: string): $CancellablePromise<void> {
|
|
return $Call.ByID(742893445, mode);
|
|
}
|
|
|
|
/**
|
|
* SetShortcut saves a single shortcut binding.
|
|
*/
|
|
export function SetShortcut(action: string, key: string): $CancellablePromise<void> {
|
|
return $Call.ByID(275130705, action, key);
|
|
}
|
|
|
|
/**
|
|
* SetShortcuts saves the entire shortcut bindings map.
|
|
*/
|
|
export function SetShortcuts(bindings: { [_ in string]?: string } | null): $CancellablePromise<void> {
|
|
return $Call.ByID(4073898118, bindings);
|
|
}
|
|
|
|
/**
|
|
* SetThemeAccentColor validates and saves a new accent colour.
|
|
*/
|
|
export function SetThemeAccentColor(color: string): $CancellablePromise<void> {
|
|
return $Call.ByID(3536665861, color);
|
|
}
|
|
|
|
/**
|
|
* SetThemeBackgroundShade validates and saves a new background shade.
|
|
*/
|
|
export function SetThemeBackgroundShade(shade: string): $CancellablePromise<void> {
|
|
return $Call.ByID(2709290065, shade);
|
|
}
|
|
|
|
/**
|
|
* SetTrackListColumns validates and saves a new column layout.
|
|
*/
|
|
export function SetTrackListColumns(columns: tracklist$0.Column[] | null): $CancellablePromise<void> {
|
|
return $Call.ByID(4226159685, columns);
|
|
}
|
|
|
|
/**
|
|
* Validate returns errors if there is a breaking issue with the config.
|
|
*/
|
|
export function Validate(): $CancellablePromise<void> {
|
|
return $Call.ByID(3087982155);
|
|
}
|