Latest WACUP beta release is build #9166 (October 21st 2021) | Latest WACUP public preview is build #7236 (March 11th 2021)


NOTE: New beta testers are not currently being added as I need to re-work the beta test program

If you've not already requested to be a beta tester & would like to then please send a PM to 'dro' to be added to the beta test group.

Note: requests to be a beta tester are processed in batches when new beta builds are released so please by patient of this process.

Author Topic: Now Playing - leading spaces not saved  (Read 2124 times)

chamber32

  • Beta Tester
  • Full Member
  • ***
  • Posts: 13
    • View Profile
Now Playing - leading spaces not saved
« on: January 05, 2020, 02:44:44 PM »
When I pad leading spaces to the Now Playing Log Details, it works, but the spaces are lost when closing WACUP.
I tried to use $lpad or $pad, but it didn't seem to work.

c32

dro

  • Admin / WACUP Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3201
    • View Profile
    • WACUP (Winamp Community Update Project)
Re: Now Playing - leading spaces not saved
« Reply #1 on: January 06, 2020, 04:12:46 PM »
The stripping of whitespace is down to how the setting are saved & something I let happen as trailing whitespace niggles me no end.

What you can do is put a $pad(,5) at the front for 5 spaces & I'll change it to also be able to do $pad(5) without needing to have an input string to start with.

The thing with the pad & lpad methods is it's handling is related to the length of the input string so you have to know the length of that to then get the desired padding which isn't the most obvious of solutions & I think I might consider another method that probably works in a more expected manner & leaving the existing pad/lpad methods alone (apart from working if there's no input string as that's reasonable imho).

-dro
« Last Edit: January 06, 2020, 04:23:52 PM by dro »

dro

  • Admin / WACUP Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3201
    • View Profile
    • WACUP (Winamp Community Update Project)
Re: Now Playing - leading spaces not saved
« Reply #2 on: January 06, 2020, 08:02:11 PM »
Changes made for the next build so there'll be a $padout() & $lpadout() which will add the padding onto the string passed instead of only padding if it's below the size provided along with the existing $pad() not needing an input string but still being able to pad with a custom character (e.g. $pad(5, #) will output #####). I think that should cover the possible usage needed without breaking any older behaviour.

-dro

chamber32

  • Beta Tester
  • Full Member
  • ***
  • Posts: 13
    • View Profile
Re: Now Playing - leading spaces not saved
« Reply #3 on: January 07, 2020, 01:08:59 AM »
Thanks for the alternative, works for me!

c32