Latest restricted WACUP beta release is build #18654 (March 24th 2024) (x86 & x64 changelogs) | Latest WACUP public preview is build #17040 (September 30th 2023) (x86 only)


NOTE: Beta testers are added in a limited & subjective manner as I can only support so many people as part of the beta test program to keep it useful for my needs.

Unless I think you're going to be helpful, not all requests will be accepted but might still be later on. Remember that beta testing is to help me & the limitations currently works for my needs for this project.

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

chamber32

  • Beta Tester
  • Sr. Member
  • ****
  • Posts: 27
    • 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: 4428
    • 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: 4428
    • 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
  • Sr. Member
  • ****
  • Posts: 27
    • 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