vhaudiquet / blade-player

Android music player that plays from local library, Spotify or Deezer
GNU General Public License v3.0
67 stars 12 forks source link

Add a "data saver" mode #41

Closed astarq closed 3 years ago

astarq commented 3 years ago

Blade seems to play music in the highest quality (with spotify, which is all I use, anyway), and it consumes a lot of a mobile data. So it would be great to have the option to lower music quality, 'cause data ain't cheap

vhaudiquet commented 3 years ago

Hi, Sorry for this late response, i don't always have internet where i am... I never saw data cost as an issue, as i have an unlimited data plan, that i don't pays much, but i can understand that this is not the case for everyone. I didn't actually code anything to select quality as i remember, the spotify api must by default choose high. I'll look into the code/doc to see if there is an option to reduce quality, and add it if i can. I'll keep you posted...

vhaudiquet commented 3 years ago

Hi, Sorry for this late response, i don't always have internet where i am... I never saw data cost as an issue, as i have an unlimited data plan, that i don't spend much on, but i can understand that this is not the case for everyone. I didn't actually code anything to select quality as i remember, the spotify api must by default choose high. I'll look into the code/doc to see if there is an option to reduce quality, and add it if i can. I'll keep you posted...

vhaudiquet commented 3 years ago

Hi, Sorry for this late response, i don't always have internet where i am... I never saw data cost as an issue, as i have an unlimited data plan, that i don't pays much, but i can understand that this is not the case for everyone. I didn't actually code anything to select quality as i remember, the spotify api must by default choose high. I'll look into the code/doc to see if there is an option to reduce quality, and add it if i can. I'll keep you posted...

astarq commented 3 years ago

Thanks, I appreciate it. Wish I could help out but I don't have the knowledge :(

vhaudiquet commented 3 years ago

Alright, I added a data saver option. This is not ideal, as it sets quality to low, and for now there is no way of setting it to medium, but it works pretty well, and on my phone speaker i can't really hear the difference. During my tests, I went from 4M to play a song without data saving to 1.5M with data saving, I hope that will be enough. I can't publish instantly to Google Play, so you'll have to download blade-1.5.3.apk directly from GitHub. Also, maybe this apk doesnt really work, or contains bugs... I had a problem with my build environment and had to set it up again so maybe there was a build problem or something, i tested it on my phone and it works but i'm not really sure it will work everywhere. Thank you for signaling your issue to me ! I hope i fixed it...

astarq commented 3 years ago

Hi and thanks! I tried it and the apk works fine on my phone. I can see the difference when I play a song now, but still after searching for and playing three songs, the data usage went up 80mb! I'm not sure what could be causing that as when I did the same in Spotify (I hadn't listened to those songs in spotify before, so they wouldn't have been cached), it only used 13mb of data. Maybe it's images that use so much? I'm not sure. I'll keep using Spotify for know, so don't feel the need to do a ton of work on this :) Thanks again!

vhaudiquet commented 3 years ago

80 MB ????? That's insane ! Without data saving mode, it tales 5-8 MB per song for me... Are you sure you didn't do a synchronization or something ? When you say "search for" did you mean using a web search or a local search ? I looked into album art loading, but i only do it at synchronization or on Blade startup if cache was deleted... I can disable cache restore when data saving mode is enabled, but theorically it shouldnt be using any data unless you manually deleted cache, and obviously if you delete cache you should expect more data consumption anyways... I don't understand how you can get to 80 MB... I'll look into data usage deeper for you, but i'm not sure I can do anything...

vhaudiquet commented 3 years ago

If you did a web search that may be because of album images actually ! I'll fix this, the web features are a little bit beta anyways...

astarq commented 3 years ago

Hi, sorry for the late reply

I did do a web search yeah... definitly didn't sync tho

vhaudiquet commented 3 years ago

New update forbids blade to load any album image from the web in data saving mode - meaning you'll see album images from your collection / that you already cached by synchronizing before, but not album images from web search. This should make mobile data consumption significantly lower. Please tell me if this isn't enough, as i can't do many testing on my own... Also feel free to tell me if it solved your issue :))

astarq commented 3 years ago

That's amazing!! Just searching for songs uses almost nothing now. That's perfect, thanks :)

Issue solved ;)