Now Playing - leading spaces not saved

  • 3 Replies
  • 76 Views
*

chamber32

  • Newbie
  • *
  • 6
    • 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
  • *****
  • 1934
    • 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
  • *****
  • 1934
    • 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

  • Newbie
  • *
  • 6
    • 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