deep-gaurav / MusicPiped

A Materialistic Music player that streams music
GNU General Public License v3.0
436 stars 59 forks source link

Custom instance settings doesn't save (and reset every sessions) #131

Open kowith337 opened 4 years ago

kowith337 commented 4 years ago

I think app doesn't save my custom Invidious instance settings, and also reset to default everytime I exit app or force stop and re-launch this app.

I'm use Snopyta's instance because it's set to proxy streams by default and can reduce connections to GoogleVideo domains

Environment

App Version: 2.1.6 Installation Source: F-Droid Device: kane_sprout Android Version: 10 (Security patch 1 March 2020)

Steps to reproduce

  1. Open app
  2. Tap vertical three dots to access settings
  3. Tap Invidious API to open custom instant settings
  4. Fill your custom instant (for example, change to https://invidious.snopyta.org/), then press Apply
  5. Exit app or...
    • Clear app session by swipe out in recent apps screen.
    • Open app settings and then Force stop.
  6. Repeat step 1 to 3

Expected behavior

Custom instance should be saved and show filled custom instance from step 4

Actual behavior

App doesn't save custom instance and revert back to https://invidio.us/

SBado commented 4 years ago

I think I found the bug.

In main.dart, starting from line 94:

  invidiosAPI.addListener(() {
    putSetting('invidiosAPI', invidiosAPI.value);
  });

Then, from line 138:

  if ((await ob.getObject('invidiousApi')) == null) {
    ob.put(invidiosAPI.value, 'invidiousApi');
  } else {
    invidiosAPI.value = await ob.getObject("invidiousApi");

@deep-gaurav As you can see, there is a mix usage of invidiousApi and invidiosAPI (without letter u).

kowith337 commented 4 years ago

Bumped for hoping of any activities...

FYI: the main invidio.us will be shutdown soon within this month, consider to fix and change to another instance before that time.