Exposing current settings to non-admin users (for theming)

Scott (ScooterPSU) 7 years ago updated 5 years ago 8

With some of the stuff I've added to my theme, it would drastically simplify if I could access settings. Really, any settings that aren't security related would be helpful.

Like if I could access whatever the user's "Reverse proxy prefix" was, I could compare the active page to the expected latest-comics page, and change the look of the "New" button accordingly.
Or if I could see if "Enable folder metadata display" is enabled, I could show/not show certain things on each page.

Otherwise I've got a list of settings at the top of a js file that need to be manually set before the first use.

I thought these settings were all kept in the preferences.xml file that is in the root with the DB.

What I'm saying is I'd like to be able to access them via javascript from within Ubooquity. Editing externally is easy.

On top of that, the xml contains every setting/username/password hash, and exposing that that would be a giant security risk.


Will be available in 2.0.3 using:


Will return something like:

  "isFilesProviderEnabled" : true,
  "isComicsProviderEnabled" : true,
  "isBooksProviderEnabled" : true,
  "isUserManagementEnabled" : false,
  "libraryPortNumber" : 2202,
  "comicWidth" : 170,
  "comicHeight" : 245,
  "comicsPaginationNumber" : 50,
  "bookWidth" : 160,
  "bookHeight" : 230,
  "booksPaginationNumber" : 30,
  "theme" : "default",
  "reverseProxyPrefix" : "",
  "isOpdsProviderEnabled" : true,
  "bypassSingleRootFolder" : true,
  "enableFolderMetadataDisplay" : true

Could the newer settings get added to this for next release?

At least "Store bookmarks in cookies instead of the server" and "Display title from metadata instead of file name" would be helpful.


Yes, will do.