PeerTube icon indicating copy to clipboard operation
PeerTube copied to clipboard

Plugin settings manager should return default value

Open kontrollanten opened this issue 1 year ago • 5 comments

Describe the current behavior

When running the following code before an admin has filled a value for SETTING_NUMBER_OF_PAGES the value from getSetting will be undefined.

  registerSetting({
    name: SETTING_NUMBER_OF_PAGES,
    label: 'Number of pages',
    default: 5,
    type: 'input'
  });

  const numberOfPages = await settingsManager.getSetting(SETTING_NUMBER_OF_PAGES)

  console.log(numberOfPages); // will be undefined

Steps to reproduce

See above.

Describe the expected behavior

getSetting should return the default value when there's no custom value set.

Additional information

  • PeerTube instance:

    • URL:
    • Version: develop
    • NodeJS version:
    • Ffmpeg version:
  • Browser name, version and platforms on which you could reproduce the bug:

  • Link to browser console log if relevant:

  • Link to server log if relevant (journalctl or /var/www/peertube/storage/logs/):

kontrollanten avatar Oct 08 '24 04:10 kontrollanten

I would like to fix this issue. Can you assign it to me?

JelenaDinic avatar Oct 21 '24 19:10 JelenaDinic

@JelenaDinic Sure!

Chocobozzz avatar Oct 22 '24 06:10 Chocobozzz

@Chocobozzz could you assign this to me?

RafyBrens avatar Nov 30 '24 18:11 RafyBrens

Done!

Chocobozzz avatar Dec 02 '24 07:12 Chocobozzz

Hi. I'm new to open source. I'd like to work on it.

AbbasReads avatar Oct 13 '25 13:10 AbbasReads